braze_api_client 0.1.0
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 +7 -0
- data/Gemfile +9 -0
- data/LICENSE.md +9 -0
- data/README.md +191 -0
- data/Rakefile +10 -0
- data/braze_api_client.gemspec +38 -0
- data/docs/Attributes.md +58 -0
- data/docs/AttributesArray.md +18 -0
- data/docs/AttributesCurrentLocation.md +20 -0
- data/docs/AttributesFacebook.md +22 -0
- data/docs/AttributesPushTokens.md +22 -0
- data/docs/AttributesTwitter.md +26 -0
- data/docs/Event.md +26 -0
- data/docs/EventsArray.md +18 -0
- data/docs/GeneralError.md +20 -0
- data/docs/Identifier.md +51 -0
- data/docs/IdentifierOneOf.md +18 -0
- data/docs/IdentifierOneOf1.md +18 -0
- data/docs/IdentifierOneOf2.md +18 -0
- data/docs/RestApi.md +427 -0
- data/docs/UsersTrackRequest.md +18 -0
- data/docs/UsersTrackResponse.md +24 -0
- data/git_push.sh +16 -0
- data/lib/braze_api_client/api/rest_api.rb +400 -0
- data/lib/braze_api_client/api_client.rb +390 -0
- data/lib/braze_api_client/api_error.rb +57 -0
- data/lib/braze_api_client/configuration.rb +294 -0
- data/lib/braze_api_client/models/attributes.rb +458 -0
- data/lib/braze_api_client/models/attributes_array.rb +225 -0
- data/lib/braze_api_client/models/attributes_current_location.rb +227 -0
- data/lib/braze_api_client/models/attributes_facebook.rb +238 -0
- data/lib/braze_api_client/models/attributes_push_tokens.rb +246 -0
- data/lib/braze_api_client/models/attributes_twitter.rb +254 -0
- data/lib/braze_api_client/models/event.rb +264 -0
- data/lib/braze_api_client/models/events_array.rb +220 -0
- data/lib/braze_api_client/models/general_error.rb +227 -0
- data/lib/braze_api_client/models/identifier.rb +106 -0
- data/lib/braze_api_client/models/identifier_one_of.rb +223 -0
- data/lib/braze_api_client/models/identifier_one_of1.rb +223 -0
- data/lib/braze_api_client/models/identifier_one_of2.rb +223 -0
- data/lib/braze_api_client/models/users_track_request.rb +245 -0
- data/lib/braze_api_client/models/users_track_response.rb +245 -0
- data/lib/braze_api_client/version.rb +15 -0
- data/lib/braze_api_client.rb +55 -0
- data/spec/api/rest_api_spec.rb +101 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/attributes_array_spec.rb +34 -0
- data/spec/models/attributes_current_location_spec.rb +40 -0
- data/spec/models/attributes_facebook_spec.rb +46 -0
- data/spec/models/attributes_push_tokens_spec.rb +46 -0
- data/spec/models/attributes_spec.rb +166 -0
- data/spec/models/attributes_twitter_spec.rb +58 -0
- data/spec/models/event_spec.rb +58 -0
- data/spec/models/events_array_spec.rb +34 -0
- data/spec/models/general_error_spec.rb +40 -0
- data/spec/models/identifier_one_of1_spec.rb +34 -0
- data/spec/models/identifier_one_of2_spec.rb +34 -0
- data/spec/models/identifier_one_of_spec.rb +34 -0
- data/spec/models/identifier_spec.rb +31 -0
- data/spec/models/users_track_request_spec.rb +34 -0
- data/spec/models/users_track_response_spec.rb +52 -0
- data/spec/spec_helper.rb +111 -0
- metadata +164 -0
data/docs/RestApi.md
ADDED
@@ -0,0 +1,427 @@
|
|
1
|
+
# BrazeClient::RestApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://rest.iad-01.braze.com*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**delete_users**](RestApi.md#delete_users) | **POST** /users/delete | |
|
8
|
+
| [**identify_users**](RestApi.md#identify_users) | **POST** /users/identify | |
|
9
|
+
| [**new_user_aliases**](RestApi.md#new_user_aliases) | **POST** /users/alias/new | |
|
10
|
+
| [**remove_external_ids**](RestApi.md#remove_external_ids) | **POST** /users/external_ids/remove | |
|
11
|
+
| [**rename_external_ids**](RestApi.md#rename_external_ids) | **POST** /users/external_ids/rename | |
|
12
|
+
| [**track_users**](RestApi.md#track_users) | **POST** /users/track | |
|
13
|
+
|
14
|
+
|
15
|
+
## delete_users
|
16
|
+
|
17
|
+
> Object delete_users(body)
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
Delete any user profile by specifying a known user identifier
|
22
|
+
|
23
|
+
### Examples
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
require 'time'
|
27
|
+
require 'braze_api_client'
|
28
|
+
# setup authorization
|
29
|
+
BrazeClient.configure do |config|
|
30
|
+
# Configure Bearer authorization: bearerAuth
|
31
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
32
|
+
end
|
33
|
+
|
34
|
+
api_instance = BrazeClient::RestApi.new
|
35
|
+
body = Object # Object |
|
36
|
+
|
37
|
+
begin
|
38
|
+
|
39
|
+
result = api_instance.delete_users(body)
|
40
|
+
p result
|
41
|
+
rescue BrazeClient::ApiError => e
|
42
|
+
puts "Error when calling RestApi->delete_users: #{e}"
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
46
|
+
#### Using the delete_users_with_http_info variant
|
47
|
+
|
48
|
+
This returns an Array which contains the response data, status code and headers.
|
49
|
+
|
50
|
+
> <Array(Object, Integer, Hash)> delete_users_with_http_info(body)
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
begin
|
54
|
+
|
55
|
+
data, status_code, headers = api_instance.delete_users_with_http_info(body)
|
56
|
+
p status_code # => 2xx
|
57
|
+
p headers # => { ... }
|
58
|
+
p data # => Object
|
59
|
+
rescue BrazeClient::ApiError => e
|
60
|
+
puts "Error when calling RestApi->delete_users_with_http_info: #{e}"
|
61
|
+
end
|
62
|
+
```
|
63
|
+
|
64
|
+
### Parameters
|
65
|
+
|
66
|
+
| Name | Type | Description | Notes |
|
67
|
+
| ---- | ---- | ----------- | ----- |
|
68
|
+
| **body** | **Object** | | |
|
69
|
+
|
70
|
+
### Return type
|
71
|
+
|
72
|
+
**Object**
|
73
|
+
|
74
|
+
### Authorization
|
75
|
+
|
76
|
+
[bearerAuth](../README.md#bearerAuth)
|
77
|
+
|
78
|
+
### HTTP request headers
|
79
|
+
|
80
|
+
- **Content-Type**: application/json
|
81
|
+
- **Accept**: application/json
|
82
|
+
|
83
|
+
|
84
|
+
## identify_users
|
85
|
+
|
86
|
+
> Object identify_users(body)
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
Identify an unidentified (alias-only) user
|
91
|
+
|
92
|
+
### Examples
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
require 'time'
|
96
|
+
require 'braze_api_client'
|
97
|
+
# setup authorization
|
98
|
+
BrazeClient.configure do |config|
|
99
|
+
# Configure Bearer authorization: bearerAuth
|
100
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
101
|
+
end
|
102
|
+
|
103
|
+
api_instance = BrazeClient::RestApi.new
|
104
|
+
body = Object # Object |
|
105
|
+
|
106
|
+
begin
|
107
|
+
|
108
|
+
result = api_instance.identify_users(body)
|
109
|
+
p result
|
110
|
+
rescue BrazeClient::ApiError => e
|
111
|
+
puts "Error when calling RestApi->identify_users: #{e}"
|
112
|
+
end
|
113
|
+
```
|
114
|
+
|
115
|
+
#### Using the identify_users_with_http_info variant
|
116
|
+
|
117
|
+
This returns an Array which contains the response data, status code and headers.
|
118
|
+
|
119
|
+
> <Array(Object, Integer, Hash)> identify_users_with_http_info(body)
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
begin
|
123
|
+
|
124
|
+
data, status_code, headers = api_instance.identify_users_with_http_info(body)
|
125
|
+
p status_code # => 2xx
|
126
|
+
p headers # => { ... }
|
127
|
+
p data # => Object
|
128
|
+
rescue BrazeClient::ApiError => e
|
129
|
+
puts "Error when calling RestApi->identify_users_with_http_info: #{e}"
|
130
|
+
end
|
131
|
+
```
|
132
|
+
|
133
|
+
### Parameters
|
134
|
+
|
135
|
+
| Name | Type | Description | Notes |
|
136
|
+
| ---- | ---- | ----------- | ----- |
|
137
|
+
| **body** | **Object** | | |
|
138
|
+
|
139
|
+
### Return type
|
140
|
+
|
141
|
+
**Object**
|
142
|
+
|
143
|
+
### Authorization
|
144
|
+
|
145
|
+
[bearerAuth](../README.md#bearerAuth)
|
146
|
+
|
147
|
+
### HTTP request headers
|
148
|
+
|
149
|
+
- **Content-Type**: application/json
|
150
|
+
- **Accept**: application/json
|
151
|
+
|
152
|
+
|
153
|
+
## new_user_aliases
|
154
|
+
|
155
|
+
> Object new_user_aliases(body)
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
Add new user aliases for existing identified users or create new unidentified users
|
160
|
+
|
161
|
+
### Examples
|
162
|
+
|
163
|
+
```ruby
|
164
|
+
require 'time'
|
165
|
+
require 'braze_api_client'
|
166
|
+
# setup authorization
|
167
|
+
BrazeClient.configure do |config|
|
168
|
+
# Configure Bearer authorization: bearerAuth
|
169
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
170
|
+
end
|
171
|
+
|
172
|
+
api_instance = BrazeClient::RestApi.new
|
173
|
+
body = Object # Object |
|
174
|
+
|
175
|
+
begin
|
176
|
+
|
177
|
+
result = api_instance.new_user_aliases(body)
|
178
|
+
p result
|
179
|
+
rescue BrazeClient::ApiError => e
|
180
|
+
puts "Error when calling RestApi->new_user_aliases: #{e}"
|
181
|
+
end
|
182
|
+
```
|
183
|
+
|
184
|
+
#### Using the new_user_aliases_with_http_info variant
|
185
|
+
|
186
|
+
This returns an Array which contains the response data, status code and headers.
|
187
|
+
|
188
|
+
> <Array(Object, Integer, Hash)> new_user_aliases_with_http_info(body)
|
189
|
+
|
190
|
+
```ruby
|
191
|
+
begin
|
192
|
+
|
193
|
+
data, status_code, headers = api_instance.new_user_aliases_with_http_info(body)
|
194
|
+
p status_code # => 2xx
|
195
|
+
p headers # => { ... }
|
196
|
+
p data # => Object
|
197
|
+
rescue BrazeClient::ApiError => e
|
198
|
+
puts "Error when calling RestApi->new_user_aliases_with_http_info: #{e}"
|
199
|
+
end
|
200
|
+
```
|
201
|
+
|
202
|
+
### Parameters
|
203
|
+
|
204
|
+
| Name | Type | Description | Notes |
|
205
|
+
| ---- | ---- | ----------- | ----- |
|
206
|
+
| **body** | **Object** | | |
|
207
|
+
|
208
|
+
### Return type
|
209
|
+
|
210
|
+
**Object**
|
211
|
+
|
212
|
+
### Authorization
|
213
|
+
|
214
|
+
[bearerAuth](../README.md#bearerAuth)
|
215
|
+
|
216
|
+
### HTTP request headers
|
217
|
+
|
218
|
+
- **Content-Type**: application/json
|
219
|
+
- **Accept**: application/json
|
220
|
+
|
221
|
+
|
222
|
+
## remove_external_ids
|
223
|
+
|
224
|
+
> Object remove_external_ids(body)
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
Remove your users' old deprecated external IDs. This endpoint completely removes the deprecated ID and cannot be undone.
|
229
|
+
|
230
|
+
### Examples
|
231
|
+
|
232
|
+
```ruby
|
233
|
+
require 'time'
|
234
|
+
require 'braze_api_client'
|
235
|
+
# setup authorization
|
236
|
+
BrazeClient.configure do |config|
|
237
|
+
# Configure Bearer authorization: bearerAuth
|
238
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
239
|
+
end
|
240
|
+
|
241
|
+
api_instance = BrazeClient::RestApi.new
|
242
|
+
body = Object # Object |
|
243
|
+
|
244
|
+
begin
|
245
|
+
|
246
|
+
result = api_instance.remove_external_ids(body)
|
247
|
+
p result
|
248
|
+
rescue BrazeClient::ApiError => e
|
249
|
+
puts "Error when calling RestApi->remove_external_ids: #{e}"
|
250
|
+
end
|
251
|
+
```
|
252
|
+
|
253
|
+
#### Using the remove_external_ids_with_http_info variant
|
254
|
+
|
255
|
+
This returns an Array which contains the response data, status code and headers.
|
256
|
+
|
257
|
+
> <Array(Object, Integer, Hash)> remove_external_ids_with_http_info(body)
|
258
|
+
|
259
|
+
```ruby
|
260
|
+
begin
|
261
|
+
|
262
|
+
data, status_code, headers = api_instance.remove_external_ids_with_http_info(body)
|
263
|
+
p status_code # => 2xx
|
264
|
+
p headers # => { ... }
|
265
|
+
p data # => Object
|
266
|
+
rescue BrazeClient::ApiError => e
|
267
|
+
puts "Error when calling RestApi->remove_external_ids_with_http_info: #{e}"
|
268
|
+
end
|
269
|
+
```
|
270
|
+
|
271
|
+
### Parameters
|
272
|
+
|
273
|
+
| Name | Type | Description | Notes |
|
274
|
+
| ---- | ---- | ----------- | ----- |
|
275
|
+
| **body** | **Object** | | |
|
276
|
+
|
277
|
+
### Return type
|
278
|
+
|
279
|
+
**Object**
|
280
|
+
|
281
|
+
### Authorization
|
282
|
+
|
283
|
+
[bearerAuth](../README.md#bearerAuth)
|
284
|
+
|
285
|
+
### HTTP request headers
|
286
|
+
|
287
|
+
- **Content-Type**: application/json
|
288
|
+
- **Accept**: application/json
|
289
|
+
|
290
|
+
|
291
|
+
## rename_external_ids
|
292
|
+
|
293
|
+
> Object rename_external_ids(body)
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
Set a new (primary) external_id for the user and deprecate their existing external_id
|
298
|
+
|
299
|
+
### Examples
|
300
|
+
|
301
|
+
```ruby
|
302
|
+
require 'time'
|
303
|
+
require 'braze_api_client'
|
304
|
+
# setup authorization
|
305
|
+
BrazeClient.configure do |config|
|
306
|
+
# Configure Bearer authorization: bearerAuth
|
307
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
308
|
+
end
|
309
|
+
|
310
|
+
api_instance = BrazeClient::RestApi.new
|
311
|
+
body = Object # Object |
|
312
|
+
|
313
|
+
begin
|
314
|
+
|
315
|
+
result = api_instance.rename_external_ids(body)
|
316
|
+
p result
|
317
|
+
rescue BrazeClient::ApiError => e
|
318
|
+
puts "Error when calling RestApi->rename_external_ids: #{e}"
|
319
|
+
end
|
320
|
+
```
|
321
|
+
|
322
|
+
#### Using the rename_external_ids_with_http_info variant
|
323
|
+
|
324
|
+
This returns an Array which contains the response data, status code and headers.
|
325
|
+
|
326
|
+
> <Array(Object, Integer, Hash)> rename_external_ids_with_http_info(body)
|
327
|
+
|
328
|
+
```ruby
|
329
|
+
begin
|
330
|
+
|
331
|
+
data, status_code, headers = api_instance.rename_external_ids_with_http_info(body)
|
332
|
+
p status_code # => 2xx
|
333
|
+
p headers # => { ... }
|
334
|
+
p data # => Object
|
335
|
+
rescue BrazeClient::ApiError => e
|
336
|
+
puts "Error when calling RestApi->rename_external_ids_with_http_info: #{e}"
|
337
|
+
end
|
338
|
+
```
|
339
|
+
|
340
|
+
### Parameters
|
341
|
+
|
342
|
+
| Name | Type | Description | Notes |
|
343
|
+
| ---- | ---- | ----------- | ----- |
|
344
|
+
| **body** | **Object** | | |
|
345
|
+
|
346
|
+
### Return type
|
347
|
+
|
348
|
+
**Object**
|
349
|
+
|
350
|
+
### Authorization
|
351
|
+
|
352
|
+
[bearerAuth](../README.md#bearerAuth)
|
353
|
+
|
354
|
+
### HTTP request headers
|
355
|
+
|
356
|
+
- **Content-Type**: application/json
|
357
|
+
- **Accept**: application/json
|
358
|
+
|
359
|
+
|
360
|
+
## track_users
|
361
|
+
|
362
|
+
> <UsersTrackResponse> track_users(users_track_request)
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
Record custom events, purchases, and update user profile attributes
|
367
|
+
|
368
|
+
### Examples
|
369
|
+
|
370
|
+
```ruby
|
371
|
+
require 'time'
|
372
|
+
require 'braze_api_client'
|
373
|
+
# setup authorization
|
374
|
+
BrazeClient.configure do |config|
|
375
|
+
# Configure Bearer authorization: bearerAuth
|
376
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
377
|
+
end
|
378
|
+
|
379
|
+
api_instance = BrazeClient::RestApi.new
|
380
|
+
users_track_request = BrazeClient::UsersTrackRequest.new({attributes: [BrazeClient::Event.new({name: 'name_example', time: Time.now})]}) # UsersTrackRequest |
|
381
|
+
|
382
|
+
begin
|
383
|
+
|
384
|
+
result = api_instance.track_users(users_track_request)
|
385
|
+
p result
|
386
|
+
rescue BrazeClient::ApiError => e
|
387
|
+
puts "Error when calling RestApi->track_users: #{e}"
|
388
|
+
end
|
389
|
+
```
|
390
|
+
|
391
|
+
#### Using the track_users_with_http_info variant
|
392
|
+
|
393
|
+
This returns an Array which contains the response data, status code and headers.
|
394
|
+
|
395
|
+
> <Array(<UsersTrackResponse>, Integer, Hash)> track_users_with_http_info(users_track_request)
|
396
|
+
|
397
|
+
```ruby
|
398
|
+
begin
|
399
|
+
|
400
|
+
data, status_code, headers = api_instance.track_users_with_http_info(users_track_request)
|
401
|
+
p status_code # => 2xx
|
402
|
+
p headers # => { ... }
|
403
|
+
p data # => <UsersTrackResponse>
|
404
|
+
rescue BrazeClient::ApiError => e
|
405
|
+
puts "Error when calling RestApi->track_users_with_http_info: #{e}"
|
406
|
+
end
|
407
|
+
```
|
408
|
+
|
409
|
+
### Parameters
|
410
|
+
|
411
|
+
| Name | Type | Description | Notes |
|
412
|
+
| ---- | ---- | ----------- | ----- |
|
413
|
+
| **users_track_request** | [**UsersTrackRequest**](UsersTrackRequest.md) | | |
|
414
|
+
|
415
|
+
### Return type
|
416
|
+
|
417
|
+
[**UsersTrackResponse**](UsersTrackResponse.md)
|
418
|
+
|
419
|
+
### Authorization
|
420
|
+
|
421
|
+
[bearerAuth](../README.md#bearerAuth)
|
422
|
+
|
423
|
+
### HTTP request headers
|
424
|
+
|
425
|
+
- **Content-Type**: application/json
|
426
|
+
- **Accept**: application/json
|
427
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# BrazeClient::UsersTrackRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **attributes** | [**Array<Event>**](Event.md) | | |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'braze_api_client'
|
13
|
+
|
14
|
+
instance = BrazeClient::UsersTrackRequest.new(
|
15
|
+
attributes: null
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# BrazeClient::UsersTrackResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **message** | **String** | | [optional] |
|
8
|
+
| **attributes_processed** | **Integer** | | [optional] |
|
9
|
+
| **events_processed** | **Integer** | | [optional] |
|
10
|
+
| **purchases_processed** | **Integer** | | [optional] |
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'braze_api_client'
|
16
|
+
|
17
|
+
instance = BrazeClient::UsersTrackResponse.new(
|
18
|
+
message: null,
|
19
|
+
attributes_processed: null,
|
20
|
+
events_processed: null,
|
21
|
+
purchases_processed: null
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
data/git_push.sh
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
|
3
|
+
cd "$parent_path"
|
4
|
+
|
5
|
+
if [ -z "$1" ]; then
|
6
|
+
echo "Provide a commit message"
|
7
|
+
exit 1
|
8
|
+
fi
|
9
|
+
|
10
|
+
git init -b main
|
11
|
+
git remote add origin git@github.com:braze-inc/braze-api-client-ruby.git
|
12
|
+
git fetch
|
13
|
+
git branch main origin/main
|
14
|
+
git add .
|
15
|
+
git commit -m "$1"
|
16
|
+
git push origin main
|