braze_ruby 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c0406b29e745be8bd5e98d2353edb96e5753c12
4
- data.tar.gz: ff30b73feb4b87a7bc02ad38a8b4b359490c2427
3
+ metadata.gz: e78db383c73ab0375f4c015ce0f99d17e7ed7035
4
+ data.tar.gz: c5d7efa4e531f247e114288e2afbba7e3f6107ec
5
5
  SHA512:
6
- metadata.gz: e22f67115caaa99d694cae39b5e2c930c352d037939313ce7ba82426c4197c094588305d4f3fa51329d3aefbc2177f1addcd07ea1dbd0a3403c43e97e995b931
7
- data.tar.gz: 54ae4986cfe73d3dddff37450bf947187aaf4b36ebbb7585b9050c6ecc34d753e6e439eaeac1c62ef78ef9bf02f376d169d564836656bd192bb1d091c0aaeefb
6
+ metadata.gz: 7400b2b2035c80486acd34dfbe77fbde74c8a56f7afc7837e9a4e773a9f636ac13d94de054dc709a040dfd5195bfc92b5534f5ad4b1108a6a85dfb909c4e1788
7
+ data.tar.gz: 1a575b9c132c8a1489bf8e9fa873dc2175ee158fd1eb05f70793872f0a9c35ebd4324f4d197ede7ba383e8194116272da9c0f4032156562fd78e6ba017dffc05
data/README.md CHANGED
@@ -137,6 +137,13 @@ api.export_users(external_ids: [1])
137
137
  ```ruby
138
138
  api.export_users(segment_id: segment_id, callback_endpoint: 'https://example.com')
139
139
  ```
140
+ ### Delete Users
141
+
142
+ #####
143
+ Delete Braze Users with an array of external_ids
144
+ ```ruby
145
+ api.delete_users([1, 2, 3])
146
+ ```
140
147
 
141
148
  ## Debugging
142
149
 
@@ -3,6 +3,7 @@ require 'braze_ruby/endpoints/track_users'
3
3
  require 'braze_ruby/endpoints/send_messages'
4
4
  require 'braze_ruby/endpoints/schedule_messages'
5
5
  require 'braze_ruby/endpoints/email_status'
6
+ require 'braze_ruby/endpoints/delete_users'
6
7
 
7
8
  module BrazeRuby
8
9
  class API
@@ -12,6 +13,7 @@ module BrazeRuby
12
13
  include BrazeRuby::Endpoints::SendMessages
13
14
  include BrazeRuby::Endpoints::ScheduleMessages
14
15
  include BrazeRuby::Endpoints::EmailStatus
16
+ include BrazeRuby::Endpoints::DeleteUsers
15
17
 
16
18
  def export_users(**payload)
17
19
  BrazeRuby::REST::ExportUsers.new(braze_url).perform(api_key, payload)
@@ -2,3 +2,4 @@ require 'braze_ruby/endpoints/email_status'
2
2
  require 'braze_ruby/endpoints/schedule_messages'
3
3
  require 'braze_ruby/endpoints/send_messages'
4
4
  require 'braze_ruby/endpoints/track_users'
5
+ require 'braze_ruby/endpoints/delete_users'
@@ -0,0 +1,21 @@
1
+ module BrazeRuby
2
+ module Endpoints
3
+ module DeleteUsers
4
+ attr_writer :delete_users_service
5
+
6
+ def delete_users_action(**payload)
7
+ delete_users_service.perform(api_key, payload)
8
+ end
9
+
10
+ def delete_users(payload)
11
+ delete_users_action(external_ids: payload.compact.uniq)
12
+ end
13
+
14
+ private
15
+
16
+ def delete_users_service
17
+ @delete_users_service ||= BrazeRuby::REST::DeleteUsers.new(braze_url)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -5,3 +5,4 @@ require 'braze_ruby/rest/schedule_messages'
5
5
  require 'braze_ruby/rest/email_status'
6
6
  require 'braze_ruby/rest/export_users'
7
7
  require 'braze_ruby/rest/list_segments'
8
+ require 'braze_ruby/rest/delete_users'
@@ -0,0 +1,12 @@
1
+ module BrazeRuby
2
+ module REST
3
+ class DeleteUsers < Base
4
+ def perform(api_key, external_ids: [])
5
+ http.post '/users/delete', {
6
+ 'api_key': api_key,
7
+ 'external_ids': external_ids
8
+ }
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module BrazeRuby
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braze_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Nussbaum
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-04-18 00:00:00.000000000 Z
13
+ date: 2018-05-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: virtus
@@ -200,6 +200,7 @@ files:
200
200
  - lib/braze_ruby/api.rb
201
201
  - lib/braze_ruby/deprecated.rb
202
202
  - lib/braze_ruby/endpoints.rb
203
+ - lib/braze_ruby/endpoints/delete_users.rb
203
204
  - lib/braze_ruby/endpoints/email_status.rb
204
205
  - lib/braze_ruby/endpoints/schedule_messages.rb
205
206
  - lib/braze_ruby/endpoints/send_messages.rb
@@ -207,6 +208,7 @@ files:
207
208
  - lib/braze_ruby/http.rb
208
209
  - lib/braze_ruby/rest.rb
209
210
  - lib/braze_ruby/rest/base.rb
211
+ - lib/braze_ruby/rest/delete_users.rb
210
212
  - lib/braze_ruby/rest/email_status.rb
211
213
  - lib/braze_ruby/rest/export_users.rb
212
214
  - lib/braze_ruby/rest/list_segments.rb