braze_api 0.1.1 → 0.1.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
- SHA256:
3
- metadata.gz: 1c2bc1697e96a039c034e07e5168804d4a1fe0f2e5b6b4748defbefdfc5832a7
4
- data.tar.gz: b8ce7276733a843fde83473d48c20e7d6d383db28ffefa55b34951ae50d92265
2
+ SHA1:
3
+ metadata.gz: 707c92f5500178e34ea769e303c2411a4474a2ec
4
+ data.tar.gz: 90519cbcb89c4be98f3e197d5412852bd1c1f529
5
5
  SHA512:
6
- metadata.gz: d2da8ba6c4c4cf445fb17ea7b3cd34dfedad13d6255bcd7201483a7737d96f5e4cddc2ac814bbd373e8931bbf761f5dc0ad669c019ecf590884ff844d6b4ebc3
7
- data.tar.gz: 216dd16457a7a0fd930b06f92b0e7973862d980b65895848f06208519cd754997352e7240f8c8d0b02e88c5a51c8df27c5d9341a129d5cd7affbaf0eab94141a
6
+ metadata.gz: c1187499da2c882c3d9662bdbe76531042daff6f0b40fd086cf840a898cefc4b02defaf0befe9dc50e7b6d39a67c77654cf0e968901181ebbc5519a70208c1b7
7
+ data.tar.gz: 3c022cbe4ebfa4262996c1c7de213b28d80bc29f9138a825e8ee8fa543290b9228977d1099f647c56a09909e206f238dca309e3196c182063f04108461c47e55
@@ -15,8 +15,7 @@ jobs:
15
15
 
16
16
  steps:
17
17
  - uses: actions/checkout@v2
18
- - name: Set up Ruby 2.4
19
- uses: actions/setup-ruby@v1
18
+ - uses: ruby/setup-ruby@v1
20
19
  with:
21
20
  ruby-version: 2.4
22
21
  bundler-cache: true
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.6
1
+ 2.4.4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,3 @@
1
- # v0.1.1
1
+ # v0.1.2
2
2
 
3
- Update faraday dependency to v0.15
3
+ Adds method to delete users.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- braze_api (0.1.1)
4
+ braze_api (0.1.2)
5
5
  faraday (~> 0.15)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # BrazeAPI
2
+ [![Gem Version](https://badge.fury.io/rb/braze_api.svg)](https://badge.fury.io/rb/braze_api) ![Lint & Test](https://github.com/appearhere/braze_api/workflows/Lint%20&%20Test/badge.svg?branch=master&event=push)
2
3
 
3
4
  The BrazeAPI gem is a Ruby wrapper for the [Braze REST API](https://www.braze.com/docs/api/basics/)
4
5
 
@@ -81,6 +82,24 @@ Called with an email and not passed fields to export will return all fields for
81
82
  ```ruby
82
83
  braze.export_users(email: 'hello@gmail.com')
83
84
  ```
85
+ ### Users Delete Endpoint:
86
+
87
+ [Delete Users](https://www.braze.com/docs/api/endpoints/user_data/post_user_delete)
88
+
89
+ Called with an array of external ids returns an object with the number of users queued for deletion
90
+ ```ruby
91
+ braze.delete_users(external_ids: ['123', '345'])
92
+ ```
93
+
94
+ Called with an array of braze ids returns an object with the number of users queued for deletion
95
+ ```ruby
96
+ braze.delete_users(braze_ids: ['123', '345'])
97
+ ```
98
+
99
+ Called with an array of user aliases returns an object with the number of users queued for deletion
100
+ ```ruby
101
+ braze.delete_users(user_aliases: [ { user_alias: { alias_name: 'pete', alias_label: 'sampras' } } ])
102
+ ```
84
103
 
85
104
  ### Subscription Groups Status Set Endpoint:
86
105
 
@@ -8,6 +8,7 @@ require 'braze_api/endpoints/users/track'
8
8
  require 'braze_api/endpoints/users/alias'
9
9
  require 'braze_api/endpoints/users/identify'
10
10
  require 'braze_api/endpoints/users/export'
11
+ require 'braze_api/endpoints/users/delete'
11
12
  require 'braze_api/endpoints/subscription_groups/status'
12
13
 
13
14
  module BrazeAPI
@@ -18,6 +19,7 @@ module BrazeAPI
18
19
  include BrazeAPI::Endpoints::Users::Alias
19
20
  include BrazeAPI::Endpoints::Users::Identify
20
21
  include BrazeAPI::Endpoints::Users::Export
22
+ include BrazeAPI::Endpoints::Users::Delete
21
23
  include BrazeAPI::Endpoints::SubscriptionGroups::Status
22
24
 
23
25
  def initialize(api_key:, braze_url:, app_id:)
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrazeAPI
4
+ module Endpoints
5
+ module Users
6
+ # Methods to call the users/delete endpoint from a client instance
7
+ module Delete
8
+ PATH = '/users/delete'
9
+
10
+ # The main method calling the endpoint.
11
+ # Called with an object containing optional keys of
12
+ # external_ids, user_aliases, braze_ids
13
+ # external_ids => optional array of strings
14
+ # braze_ids => optional array of strings
15
+ # user_aliases => optional array of UserAlias objects
16
+ def delete_users(external_ids: [], user_aliases: [], braze_ids: [])
17
+ args = {}
18
+ args[:external_ids] = external_ids unless external_ids.empty?
19
+ args[:braze_ids] = braze_ids unless braze_ids.empty?
20
+ args[:user_aliases] = user_aliases unless user_aliases.empty?
21
+ post(PATH, params: args)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BrazeAPI
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braze_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janie Amero
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-25 00:00:00.000000000 Z
11
+ date: 2022-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -120,6 +120,7 @@ files:
120
120
  - lib/braze_api/client.rb
121
121
  - lib/braze_api/endpoints/subscription_groups/status.rb
122
122
  - lib/braze_api/endpoints/users/alias.rb
123
+ - lib/braze_api/endpoints/users/delete.rb
123
124
  - lib/braze_api/endpoints/users/export.rb
124
125
  - lib/braze_api/endpoints/users/identify.rb
125
126
  - lib/braze_api/endpoints/users/track.rb
@@ -148,7 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
149
  - !ruby/object:Gem::Version
149
150
  version: '0'
150
151
  requirements: []
151
- rubygems_version: 3.0.3
152
+ rubyforge_project:
153
+ rubygems_version: 2.6.14.1
152
154
  signing_key:
153
155
  specification_version: 4
154
156
  summary: Braze API wrapper for Ruby