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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +14 -3
- data/Gemfile.lock +43 -39
- data/README.md +59 -0
- data/braze_ruby.gemspec +7 -7
- data/lib/braze_ruby/api.rb +11 -4
- data/lib/braze_ruby/endpoints.rb +4 -0
- 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 +19 -0
- 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 -3
- data/lib/braze_ruby/endpoints/track_users.rb +5 -5
- data/lib/braze_ruby/http.rb +18 -5
- data/lib/braze_ruby/rest.rb +4 -0
- data/lib/braze_ruby/rest/base.rb +4 -2
- data/lib/braze_ruby/rest/canvas_details.rb +3 -5
- data/lib/braze_ruby/rest/create_user_aliases.rb +13 -0
- data/lib/braze_ruby/rest/delete_users.rb +1 -2
- data/lib/braze_ruby/rest/email_hard_bounces.rb +3 -5
- data/lib/braze_ruby/rest/email_status.rb +3 -5
- data/lib/braze_ruby/rest/email_unsubscribes.rb +3 -5
- data/lib/braze_ruby/rest/export_users.rb +5 -7
- data/lib/braze_ruby/rest/identify_users.rb +13 -0
- 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 +3 -5
- data/lib/braze_ruby/rest/send_messages.rb +3 -5
- data/lib/braze_ruby/rest/subscription_status_get.rb +3 -5
- data/lib/braze_ruby/rest/subscription_status_set.rb +3 -5
- data/lib/braze_ruby/rest/subscription_user_status.rb +3 -5
- data/lib/braze_ruby/rest/track_users.rb +1 -2
- data/lib/braze_ruby/rest/trigger_campaign_send.rb +4 -8
- data/lib/braze_ruby/rest/trigger_canvas_send.rb +3 -5
- data/lib/braze_ruby/version.rb +1 -1
- data/spec/braze_ruby/endpoints/delete_users_spec.rb +1 -1
- data/spec/braze_ruby/endpoints/track_users_spec.rb +8 -8
- data/spec/braze_ruby/http_spec.rb +48 -0
- data/spec/braze_ruby/rest/create_user_aliases_spec.rb +23 -0
- data/spec/braze_ruby/rest/delete_users_spec.rb +3 -3
- data/spec/braze_ruby/rest/email_status_spec.rb +1 -2
- data/spec/braze_ruby/rest/export_users_spec.rb +3 -3
- data/spec/braze_ruby/rest/identify_users_spec.rb +23 -0
- data/spec/braze_ruby/rest/remove_external_ids_spec.rb +22 -0
- data/spec/braze_ruby/rest/rename_external_ids_spec.rb +22 -0
- data/spec/braze_ruby/rest/schedule_messages_spec.rb +1 -2
- data/spec/braze_ruby/rest/send_messages_spec.rb +8 -13
- data/spec/braze_ruby/rest/track_users_spec.rb +10 -9
- data/spec/fixtures/responses/campaigns/trigger_send/sends_an_email.yml +17 -15
- data/spec/fixtures/responses/canvas/details/returns_error_when_no_canvas.yml +16 -14
- data/spec/fixtures/responses/canvas/trigger_send/sends_a_canvas.yml +18 -16
- data/spec/fixtures/responses/create_user_aliases/unauthorized/responds_with_unauthorized.yml +67 -0
- data/spec/fixtures/responses/create_user_aliases/with_success/responds_with_created.yml +71 -0
- data/spec/fixtures/responses/create_user_aliases/with_success/responds_with_success_message.yml +71 -0
- data/spec/fixtures/responses/delete_users/unauthorized/responds_with_unauthorized.yml +20 -18
- data/spec/fixtures/responses/delete_users/with_success/responds_with_created.yml +25 -23
- data/spec/fixtures/responses/delete_users/with_success/responds_with_success_message.yml +25 -23
- data/spec/fixtures/responses/email_status/existing_email/responds_with_created.yml +22 -20
- data/spec/fixtures/responses/email_status/existing_email/responds_with_success_message.yml +22 -20
- data/spec/fixtures/responses/email_status/unknown_email/responds_with_bad_request.yml +22 -20
- data/spec/fixtures/responses/email_status/unknown_email/responds_with_success_message.yml +22 -20
- data/spec/fixtures/responses/email_sync/hard_bounces/responds_with_empty_array_when_no_hard_bounces.yml +18 -16
- data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_empty_array_when_no_unsubscribes.yml +18 -16
- data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_unsubscribed_emails.yml +21 -20
- data/spec/fixtures/responses/export_users/by_ids/with_success/responds_with_created.yml +25 -22
- data/spec/fixtures/responses/export_users/by_segment/with_success/responds_with_created.yml +24 -22
- data/spec/fixtures/responses/identify_users/unauthorized/responds_with_unauthorized.yml +68 -0
- data/spec/fixtures/responses/identify_users/with_success/responds_with_created.yml +71 -0
- data/spec/fixtures/responses/identify_users/with_success/responds_with_success_message.yml +71 -0
- data/spec/fixtures/responses/list_segments/with_success/responds_with_a_list_of_segments.yml +35 -35
- data/spec/fixtures/responses/list_segments/with_success/responds_with_success.yml +35 -35
- data/spec/fixtures/responses/remove_external_ids/unauthorized/responds_with_unauthorized.yml +67 -0
- data/spec/fixtures/responses/remove_external_ids/with_success/responds_with_created.yml +69 -0
- data/spec/fixtures/responses/remove_external_ids/with_success/responds_with_success_message.yml +69 -0
- data/spec/fixtures/responses/rename_external_ids/unauthorized/responds_with_unauthorized.yml +67 -0
- data/spec/fixtures/responses/rename_external_ids/with_success/responds_with_created.yml +69 -0
- data/spec/fixtures/responses/rename_external_ids/with_success/responds_with_success_message.yml +69 -0
- data/spec/fixtures/responses/schedule_messages/unauthorized/responds_with_unauthorize.yml +20 -19
- data/spec/fixtures/responses/schedule_messages/with_success/responds_with_created.yml +24 -23
- data/spec/fixtures/responses/schedule_messages/with_success/responds_with_success_message.yml +24 -23
- data/spec/fixtures/responses/send_messages/unauthorized/responds_with_unauthorized.yml +20 -18
- data/spec/fixtures/responses/send_messages/with_success/responds_with_created.yml +24 -22
- data/spec/fixtures/responses/send_messages/with_success/responds_with_success_message.yml +24 -22
- data/spec/fixtures/responses/subscription/subscription_status_set/when_subscribing/subscribes_the_user.yml +16 -14
- data/spec/fixtures/responses/subscription/subscription_status_set/when_subscription_group_does_not_exist/returns_an_error_status.yml +16 -14
- data/spec/fixtures/responses/subscription/subscription_status_set/when_unsubscribing/unsubscribes_the_user.yml +32 -28
- 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
- data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_status_get/when_group_does_not_exist/returns_an_error.yml +48 -42
- data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_user_status/returns_subscription_groups_and_status_for_every_group.yml +50 -46
- data/spec/fixtures/responses/track_users/unauthorized/responds_with_unauthorized.yml +23 -21
- data/spec/fixtures/responses/track_users/with_success/responds_with_created.yml +22 -20
- data/spec/fixtures/responses/track_users/with_success/responds_with_success_message.yml +22 -20
- data/spec/integrations/campaigns_spec.rb +4 -2
- data/spec/integrations/canvas_spec.rb +4 -2
- data/spec/integrations/create_user_aliases_spec.rb +32 -0
- data/spec/integrations/delete_users_spec.rb +1 -0
- data/spec/integrations/email_sync_spec.rb +2 -2
- data/spec/integrations/export_users_spec.rb +2 -2
- data/spec/integrations/identify_users_spec.rb +32 -0
- data/spec/integrations/list_segments_spec.rb +1 -1
- data/spec/integrations/remove_external_ids_spec.rb +33 -0
- data/spec/integrations/rename_external_ids_spec.rb +37 -0
- data/spec/integrations/schedule_messages_spec.rb +2 -1
- data/spec/integrations/send_messages_spec.rb +2 -1
- data/spec/integrations/subscription_spec.rb +7 -7
- data/spec/integrations/track_users_spec.rb +1 -0
- data/spec/spec_helper.rb +0 -8
- data/spec/support/integrations.rb +5 -1
- data/spec/support/vcr.rb +3 -1
- metadata +69 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8aae95520a637f8bfb69c12c2df7700966eec68e243743fabc03798b194a924f
|
4
|
+
data.tar.gz: 95791c077beeb50119d715e81374533778032ee85d1fef28ed946352a1bd618b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61bd0b6c2bb7c59e396cc1c3aa40fe0b54095c95f0195c5287e96c6e8504955442052a36d8e137150e816a357e2ae2982c112d4a79df95047d4841adf9b8b448
|
7
|
+
data.tar.gz: 1ac6bb7da1dc22c6138c62a00072ec62d82d48ac2ee8b2922607c62dabcd7febe36b798c606466d85c88bc86f8d01067f347a3c4b11d0d92ba7c46a003b6ea91
|
data/.github/workflows/ci.yml
CHANGED
@@ -7,13 +7,24 @@ jobs:
|
|
7
7
|
runs-on: ubuntu-latest
|
8
8
|
|
9
9
|
steps:
|
10
|
-
- uses: actions/checkout@
|
10
|
+
- uses: actions/checkout@v2
|
11
|
+
|
11
12
|
- name: Set up Ruby
|
12
|
-
uses:
|
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
|
-
|
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.
|
5
|
-
faraday
|
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.
|
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.
|
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.
|
19
|
-
concurrent-ruby (1.1.
|
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.
|
24
|
+
factory_bot (5.2.0)
|
25
25
|
activesupport (>= 4.2.0)
|
26
|
-
faraday (
|
26
|
+
faraday (1.3.0)
|
27
|
+
faraday-net_http (~> 1.0)
|
27
28
|
multipart-post (>= 1.2, < 3)
|
28
|
-
|
29
|
-
|
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.
|
32
|
-
minitest (5.
|
34
|
+
method_source (1.0.0)
|
35
|
+
minitest (5.14.1)
|
33
36
|
multipart-post (2.1.1)
|
34
|
-
pry (0.
|
35
|
-
coderay (~> 1.1
|
36
|
-
method_source (~>
|
37
|
-
public_suffix (4.0.
|
38
|
-
rake (
|
39
|
-
rspec (3.
|
40
|
-
rspec-core (~> 3.
|
41
|
-
rspec-expectations (~> 3.
|
42
|
-
rspec-mocks (~> 3.
|
43
|
-
rspec-core (3.
|
44
|
-
rspec-support (~> 3.
|
45
|
-
rspec-expectations (3.
|
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.
|
48
|
-
rspec-mocks (3.
|
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.
|
51
|
-
rspec-support (3.
|
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.
|
58
|
+
tzinfo (1.2.7)
|
55
59
|
thread_safe (~> 0.1)
|
56
|
-
vcr (
|
57
|
-
webmock (3.
|
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.
|
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 (
|
71
|
-
pry (
|
72
|
-
rake (
|
73
|
-
rspec (~> 3.8
|
74
|
-
vcr (
|
75
|
-
webmock (
|
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.
|
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'
|
28
|
+
spec.add_dependency 'faraday'
|
29
29
|
|
30
30
|
spec.add_development_dependency 'bundler', '>= 1.3'
|
31
|
-
spec.add_development_dependency 'rake', '
|
32
|
-
spec.add_development_dependency 'rspec', '~> 3.8
|
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', '
|
35
|
-
spec.add_development_dependency 'webmock', '
|
36
|
-
spec.add_development_dependency 'pry', '
|
37
|
-
spec.add_development_dependency 'factory_bot', '
|
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
|
data/lib/braze_ruby/api.rb
CHANGED
@@ -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(
|
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
|
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
|
data/lib/braze_ruby/endpoints.rb
CHANGED
@@ -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(
|
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,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
|