braze_api 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/workflows/main.yml +1 -2
- data/.ruby-version +1 -1
- data/CHANGELOG.md +2 -2
- data/Gemfile.lock +1 -1
- data/README.md +19 -0
- data/lib/braze_api/client.rb +2 -0
- data/lib/braze_api/endpoints/users/delete.rb +26 -0
- data/lib/braze_api/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 707c92f5500178e34ea769e303c2411a4474a2ec
|
4
|
+
data.tar.gz: 90519cbcb89c4be98f3e197d5412852bd1c1f529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1187499da2c882c3d9662bdbe76531042daff6f0b40fd086cf840a898cefc4b02defaf0befe9dc50e7b6d39a67c77654cf0e968901181ebbc5519a70208c1b7
|
7
|
+
data.tar.gz: 3c022cbe4ebfa4262996c1c7de213b28d80bc29f9138a825e8ee8fa543290b9228977d1099f647c56a09909e206f238dca309e3196c182063f04108461c47e55
|
data/.github/workflows/main.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.4.4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
# v0.1.
|
1
|
+
# v0.1.2
|
2
2
|
|
3
|
-
|
3
|
+
Adds method to delete users.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# BrazeAPI
|
2
|
+
[](https://badge.fury.io/rb/braze_api) 
|
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
|
|
data/lib/braze_api/client.rb
CHANGED
@@ -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
|
data/lib/braze_api/version.rb
CHANGED
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.
|
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:
|
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
|
-
|
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
|