onesignal 0.3.0 → 1.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +6 -1
- data/README.md +126 -111
- data/Rakefile +8 -8
- data/docs/App.md +76 -0
- data/docs/Button.md +22 -0
- data/docs/DefaultApi.md +1394 -0
- data/docs/DeliveryData.md +26 -0
- data/docs/ExportPlayersRequestBody.md +22 -0
- data/docs/Filter.md +24 -0
- data/docs/FilterExpressions.md +26 -0
- data/docs/FilterNotificationTarget.md +40 -0
- data/docs/GetNotificationRequestBody.md +22 -0
- data/docs/InlineResponse200.md +24 -0
- data/docs/InlineResponse2001.md +18 -0
- data/docs/InlineResponse2002.md +20 -0
- data/docs/InlineResponse2003.md +18 -0
- data/docs/InlineResponse2004.md +20 -0
- data/docs/InlineResponse2005.md +18 -0
- data/docs/InlineResponse201.md +20 -0
- data/docs/InlineResponse400.md +18 -0
- data/docs/InlineResponse4001.md +20 -0
- data/docs/InlineResponse4002.md +18 -0
- data/docs/InlineResponse409.md +20 -0
- data/docs/Notification.md +240 -0
- data/docs/NotificationAllOf.md +192 -0
- data/docs/NotificationAllOfAndroidBackgroundLayout.md +22 -0
- data/docs/NotificationSlice.md +24 -0
- data/docs/NotificationTarget.md +64 -0
- data/docs/Operator.md +18 -0
- data/docs/OutcomeData.md +22 -0
- data/docs/PlatformDeliveryData.md +28 -0
- data/docs/Player.md +70 -0
- data/docs/PlayerNotificationTarget.md +36 -0
- data/docs/PlayerSlice.md +24 -0
- data/docs/Purchase.md +22 -0
- data/docs/Segment.md +22 -0
- data/docs/SegmentNotificationTarget.md +20 -0
- data/docs/StringMap.md +102 -0
- data/docs/UpdatePlayerTagsRequestBody.md +18 -0
- data/git_push.sh +58 -0
- data/lib/OneSignal.rb +75 -0
- data/lib/onesignal/api/default_api.rb +1338 -0
- data/lib/onesignal/api_client.rb +391 -0
- data/lib/onesignal/api_error.rb +57 -0
- data/lib/onesignal/configuration.rb +242 -0
- data/lib/onesignal/models/app.rb +519 -13
- data/lib/onesignal/models/button.rb +241 -0
- data/lib/onesignal/models/delivery_data.rb +254 -0
- data/lib/onesignal/models/export_players_request_body.rb +241 -0
- data/lib/onesignal/models/filter.rb +293 -0
- data/lib/onesignal/models/filter_expressions.rb +335 -0
- data/lib/onesignal/models/filter_notification_target.rb +329 -0
- data/lib/onesignal/models/get_notification_request_body.rb +272 -0
- data/lib/onesignal/models/inline_response200.rb +256 -0
- data/lib/onesignal/models/inline_response2001.rb +218 -0
- data/lib/onesignal/models/inline_response2002.rb +227 -0
- data/lib/onesignal/models/inline_response2003.rb +218 -0
- data/lib/onesignal/models/inline_response2004.rb +227 -0
- data/lib/onesignal/models/inline_response2005.rb +218 -0
- data/lib/onesignal/models/inline_response201.rb +228 -0
- data/lib/onesignal/models/inline_response400.rb +220 -0
- data/lib/onesignal/models/inline_response4001.rb +229 -0
- data/lib/onesignal/models/inline_response4002.rb +220 -0
- data/lib/onesignal/models/inline_response409.rb +229 -0
- data/lib/onesignal/models/notification.rb +1395 -5
- data/lib/onesignal/models/notification_all_of.rb +1124 -0
- data/lib/onesignal/models/notification_all_of_android_background_layout.rb +240 -0
- data/lib/onesignal/models/notification_slice.rb +247 -0
- data/lib/onesignal/models/notification_target.rb +494 -0
- data/lib/onesignal/models/operator.rb +253 -0
- data/lib/onesignal/models/outcome_data.rb +285 -0
- data/lib/onesignal/models/platform_delivery_data.rb +264 -0
- data/lib/onesignal/models/player.rb +483 -9
- data/lib/onesignal/models/player_notification_target.rb +329 -0
- data/lib/onesignal/models/player_slice.rb +247 -0
- data/lib/onesignal/models/purchase.rb +254 -0
- data/lib/onesignal/models/segment.rb +251 -0
- data/lib/onesignal/models/segment_notification_target.rb +233 -0
- data/lib/onesignal/models/string_map.rb +644 -0
- data/lib/onesignal/models/update_player_tags_request_body.rb +219 -0
- data/lib/onesignal/version.rb +13 -1
- data/onesignal.gemspec +36 -27
- data/spec/api/default_api_spec.rb +285 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/app_spec.rb +212 -0
- data/spec/models/button_spec.rb +46 -0
- data/spec/models/delivery_data_spec.rb +58 -0
- data/spec/models/export_players_request_body_spec.rb +46 -0
- data/spec/models/filter_expressions_spec.rb +66 -0
- data/spec/models/filter_notification_target_spec.rb +100 -0
- data/spec/models/filter_spec.rb +56 -0
- data/spec/models/get_notification_request_body_spec.rb +50 -0
- data/spec/models/inline_response2001_spec.rb +34 -0
- data/spec/models/inline_response2002_spec.rb +40 -0
- data/spec/models/inline_response2003_spec.rb +34 -0
- data/spec/models/inline_response2004_spec.rb +40 -0
- data/spec/models/inline_response2005_spec.rb +34 -0
- data/spec/models/inline_response200_spec.rb +52 -0
- data/spec/models/inline_response201_spec.rb +40 -0
- data/spec/models/inline_response4001_spec.rb +40 -0
- data/spec/models/inline_response4002_spec.rb +34 -0
- data/spec/models/inline_response400_spec.rb +34 -0
- data/spec/models/inline_response409_spec.rb +40 -0
- data/spec/models/notification_all_of_android_background_layout_spec.rb +46 -0
- data/spec/models/notification_all_of_spec.rb +560 -0
- data/spec/models/notification_slice_spec.rb +52 -0
- data/spec/models/notification_spec.rb +704 -0
- data/spec/models/notification_target_spec.rb +172 -0
- data/spec/models/operator_spec.rb +38 -0
- data/spec/models/outcome_data_spec.rb +50 -0
- data/spec/models/platform_delivery_data_spec.rb +64 -0
- data/spec/models/player_notification_target_spec.rb +88 -0
- data/spec/models/player_slice_spec.rb +52 -0
- data/spec/models/player_spec.rb +190 -0
- data/spec/models/purchase_spec.rb +46 -0
- data/spec/models/segment_notification_target_spec.rb +40 -0
- data/spec/models/segment_spec.rb +46 -0
- data/spec/models/string_map_spec.rb +286 -0
- data/spec/models/update_player_tags_request_body_spec.rb +34 -0
- data/spec/spec_helper.rb +111 -0
- metadata +182 -65
- data/.gitignore +0 -10
- data/.rubocop.yml +0 -17
- data/.travis.yml +0 -16
- data/CHANGELOG.md +0 -22
- data/CODE_OF_CONDUCT.md +0 -49
- data/LICENSE +0 -21
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/lib/onesignal/app_id_missing_error.rb +0 -7
- data/lib/onesignal/client.rb +0 -44
- data/lib/onesignal/models/base_model.rb +0 -40
- data/lib/onesignal/request.rb +0 -94
- data/lib/onesignal/request_error.rb +0 -21
- data/lib/onesignal/resources/app_resource.rb +0 -27
- data/lib/onesignal/resources/base_resource.rb +0 -35
- data/lib/onesignal/resources/notification_resource.rb +0 -33
- data/lib/onesignal/resources/player_resource.rb +0 -53
- data/lib/onesignal.rb +0 -23
metadata
CHANGED
@@ -1,105 +1,184 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onesignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- OneSignal
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: typhoeus
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
20
|
-
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.11'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: minitest
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
19
|
+
version: '1.0'
|
20
|
+
- - ">="
|
32
21
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
34
|
-
type: :
|
22
|
+
version: 1.0.1
|
23
|
+
type: :runtime
|
35
24
|
prerelease: false
|
36
25
|
version_requirements: !ruby/object:Gem::Requirement
|
37
26
|
requirements:
|
38
27
|
- - "~>"
|
39
28
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
41
|
-
-
|
42
|
-
name: rake
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '10.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
29
|
+
version: '1.0'
|
30
|
+
- - ">="
|
53
31
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
32
|
+
version: 1.0.1
|
55
33
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
34
|
+
name: rspec
|
57
35
|
requirement: !ruby/object:Gem::Requirement
|
58
36
|
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 3.6.0
|
59
40
|
- - "~>"
|
60
41
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
42
|
+
version: '3.6'
|
62
43
|
type: :development
|
63
44
|
prerelease: false
|
64
45
|
version_requirements: !ruby/object:Gem::Requirement
|
65
46
|
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 3.6.0
|
66
50
|
- - "~>"
|
67
51
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
69
|
-
description:
|
52
|
+
version: '3.6'
|
53
|
+
description: OneSignal
|
70
54
|
email:
|
71
|
-
-
|
55
|
+
- devrel@onesignal.com
|
72
56
|
executables: []
|
73
57
|
extensions: []
|
74
58
|
extra_rdoc_files: []
|
75
59
|
files:
|
76
|
-
- ".gitignore"
|
77
|
-
- ".rubocop.yml"
|
78
|
-
- ".travis.yml"
|
79
|
-
- CHANGELOG.md
|
80
|
-
- CODE_OF_CONDUCT.md
|
81
60
|
- Gemfile
|
82
|
-
- LICENSE
|
83
61
|
- README.md
|
84
62
|
- Rakefile
|
85
|
-
-
|
86
|
-
-
|
87
|
-
-
|
88
|
-
-
|
89
|
-
-
|
63
|
+
- docs/App.md
|
64
|
+
- docs/Button.md
|
65
|
+
- docs/DefaultApi.md
|
66
|
+
- docs/DeliveryData.md
|
67
|
+
- docs/ExportPlayersRequestBody.md
|
68
|
+
- docs/Filter.md
|
69
|
+
- docs/FilterExpressions.md
|
70
|
+
- docs/FilterNotificationTarget.md
|
71
|
+
- docs/GetNotificationRequestBody.md
|
72
|
+
- docs/InlineResponse200.md
|
73
|
+
- docs/InlineResponse2001.md
|
74
|
+
- docs/InlineResponse2002.md
|
75
|
+
- docs/InlineResponse2003.md
|
76
|
+
- docs/InlineResponse2004.md
|
77
|
+
- docs/InlineResponse2005.md
|
78
|
+
- docs/InlineResponse201.md
|
79
|
+
- docs/InlineResponse400.md
|
80
|
+
- docs/InlineResponse4001.md
|
81
|
+
- docs/InlineResponse4002.md
|
82
|
+
- docs/InlineResponse409.md
|
83
|
+
- docs/Notification.md
|
84
|
+
- docs/NotificationAllOf.md
|
85
|
+
- docs/NotificationAllOfAndroidBackgroundLayout.md
|
86
|
+
- docs/NotificationSlice.md
|
87
|
+
- docs/NotificationTarget.md
|
88
|
+
- docs/Operator.md
|
89
|
+
- docs/OutcomeData.md
|
90
|
+
- docs/PlatformDeliveryData.md
|
91
|
+
- docs/Player.md
|
92
|
+
- docs/PlayerNotificationTarget.md
|
93
|
+
- docs/PlayerSlice.md
|
94
|
+
- docs/Purchase.md
|
95
|
+
- docs/Segment.md
|
96
|
+
- docs/SegmentNotificationTarget.md
|
97
|
+
- docs/StringMap.md
|
98
|
+
- docs/UpdatePlayerTagsRequestBody.md
|
99
|
+
- git_push.sh
|
100
|
+
- lib/OneSignal.rb
|
101
|
+
- lib/onesignal/api/default_api.rb
|
102
|
+
- lib/onesignal/api_client.rb
|
103
|
+
- lib/onesignal/api_error.rb
|
104
|
+
- lib/onesignal/configuration.rb
|
90
105
|
- lib/onesignal/models/app.rb
|
91
|
-
- lib/onesignal/models/
|
106
|
+
- lib/onesignal/models/button.rb
|
107
|
+
- lib/onesignal/models/delivery_data.rb
|
108
|
+
- lib/onesignal/models/export_players_request_body.rb
|
109
|
+
- lib/onesignal/models/filter.rb
|
110
|
+
- lib/onesignal/models/filter_expressions.rb
|
111
|
+
- lib/onesignal/models/filter_notification_target.rb
|
112
|
+
- lib/onesignal/models/get_notification_request_body.rb
|
113
|
+
- lib/onesignal/models/inline_response200.rb
|
114
|
+
- lib/onesignal/models/inline_response2001.rb
|
115
|
+
- lib/onesignal/models/inline_response2002.rb
|
116
|
+
- lib/onesignal/models/inline_response2003.rb
|
117
|
+
- lib/onesignal/models/inline_response2004.rb
|
118
|
+
- lib/onesignal/models/inline_response2005.rb
|
119
|
+
- lib/onesignal/models/inline_response201.rb
|
120
|
+
- lib/onesignal/models/inline_response400.rb
|
121
|
+
- lib/onesignal/models/inline_response4001.rb
|
122
|
+
- lib/onesignal/models/inline_response4002.rb
|
123
|
+
- lib/onesignal/models/inline_response409.rb
|
92
124
|
- lib/onesignal/models/notification.rb
|
125
|
+
- lib/onesignal/models/notification_all_of.rb
|
126
|
+
- lib/onesignal/models/notification_all_of_android_background_layout.rb
|
127
|
+
- lib/onesignal/models/notification_slice.rb
|
128
|
+
- lib/onesignal/models/notification_target.rb
|
129
|
+
- lib/onesignal/models/operator.rb
|
130
|
+
- lib/onesignal/models/outcome_data.rb
|
131
|
+
- lib/onesignal/models/platform_delivery_data.rb
|
93
132
|
- lib/onesignal/models/player.rb
|
94
|
-
- lib/onesignal/
|
95
|
-
- lib/onesignal/
|
96
|
-
- lib/onesignal/
|
97
|
-
- lib/onesignal/
|
98
|
-
- lib/onesignal/
|
99
|
-
- lib/onesignal/
|
133
|
+
- lib/onesignal/models/player_notification_target.rb
|
134
|
+
- lib/onesignal/models/player_slice.rb
|
135
|
+
- lib/onesignal/models/purchase.rb
|
136
|
+
- lib/onesignal/models/segment.rb
|
137
|
+
- lib/onesignal/models/segment_notification_target.rb
|
138
|
+
- lib/onesignal/models/string_map.rb
|
139
|
+
- lib/onesignal/models/update_player_tags_request_body.rb
|
100
140
|
- lib/onesignal/version.rb
|
101
141
|
- onesignal.gemspec
|
102
|
-
|
142
|
+
- spec/api/default_api_spec.rb
|
143
|
+
- spec/api_client_spec.rb
|
144
|
+
- spec/configuration_spec.rb
|
145
|
+
- spec/models/app_spec.rb
|
146
|
+
- spec/models/button_spec.rb
|
147
|
+
- spec/models/delivery_data_spec.rb
|
148
|
+
- spec/models/export_players_request_body_spec.rb
|
149
|
+
- spec/models/filter_expressions_spec.rb
|
150
|
+
- spec/models/filter_notification_target_spec.rb
|
151
|
+
- spec/models/filter_spec.rb
|
152
|
+
- spec/models/get_notification_request_body_spec.rb
|
153
|
+
- spec/models/inline_response2001_spec.rb
|
154
|
+
- spec/models/inline_response2002_spec.rb
|
155
|
+
- spec/models/inline_response2003_spec.rb
|
156
|
+
- spec/models/inline_response2004_spec.rb
|
157
|
+
- spec/models/inline_response2005_spec.rb
|
158
|
+
- spec/models/inline_response200_spec.rb
|
159
|
+
- spec/models/inline_response201_spec.rb
|
160
|
+
- spec/models/inline_response4001_spec.rb
|
161
|
+
- spec/models/inline_response4002_spec.rb
|
162
|
+
- spec/models/inline_response400_spec.rb
|
163
|
+
- spec/models/inline_response409_spec.rb
|
164
|
+
- spec/models/notification_all_of_android_background_layout_spec.rb
|
165
|
+
- spec/models/notification_all_of_spec.rb
|
166
|
+
- spec/models/notification_slice_spec.rb
|
167
|
+
- spec/models/notification_spec.rb
|
168
|
+
- spec/models/notification_target_spec.rb
|
169
|
+
- spec/models/operator_spec.rb
|
170
|
+
- spec/models/outcome_data_spec.rb
|
171
|
+
- spec/models/platform_delivery_data_spec.rb
|
172
|
+
- spec/models/player_notification_target_spec.rb
|
173
|
+
- spec/models/player_slice_spec.rb
|
174
|
+
- spec/models/player_spec.rb
|
175
|
+
- spec/models/purchase_spec.rb
|
176
|
+
- spec/models/segment_notification_target_spec.rb
|
177
|
+
- spec/models/segment_spec.rb
|
178
|
+
- spec/models/string_map_spec.rb
|
179
|
+
- spec/models/update_player_tags_request_body_spec.rb
|
180
|
+
- spec/spec_helper.rb
|
181
|
+
homepage: https://onesignal.com/
|
103
182
|
licenses:
|
104
183
|
- MIT
|
105
184
|
metadata: {}
|
@@ -111,16 +190,54 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
190
|
requirements:
|
112
191
|
- - ">="
|
113
192
|
- !ruby/object:Gem::Version
|
114
|
-
version: 2.
|
193
|
+
version: '2.4'
|
115
194
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
195
|
requirements:
|
117
|
-
- - "
|
196
|
+
- - ">"
|
118
197
|
- !ruby/object:Gem::Version
|
119
|
-
version:
|
198
|
+
version: 1.3.1
|
120
199
|
requirements: []
|
121
|
-
|
122
|
-
rubygems_version: 2.5.1
|
200
|
+
rubygems_version: 3.0.3
|
123
201
|
signing_key:
|
124
202
|
specification_version: 4
|
125
|
-
summary:
|
126
|
-
test_files:
|
203
|
+
summary: OneSignal
|
204
|
+
test_files:
|
205
|
+
- spec/api/default_api_spec.rb
|
206
|
+
- spec/api_client_spec.rb
|
207
|
+
- spec/configuration_spec.rb
|
208
|
+
- spec/models/notification_spec.rb
|
209
|
+
- spec/models/notification_target_spec.rb
|
210
|
+
- spec/models/inline_response2002_spec.rb
|
211
|
+
- spec/models/filter_notification_target_spec.rb
|
212
|
+
- spec/models/get_notification_request_body_spec.rb
|
213
|
+
- spec/models/update_player_tags_request_body_spec.rb
|
214
|
+
- spec/models/segment_spec.rb
|
215
|
+
- spec/models/delivery_data_spec.rb
|
216
|
+
- spec/models/inline_response2003_spec.rb
|
217
|
+
- spec/models/segment_notification_target_spec.rb
|
218
|
+
- spec/models/inline_response2001_spec.rb
|
219
|
+
- spec/models/player_slice_spec.rb
|
220
|
+
- spec/models/outcome_data_spec.rb
|
221
|
+
- spec/models/string_map_spec.rb
|
222
|
+
- spec/models/player_spec.rb
|
223
|
+
- spec/models/player_notification_target_spec.rb
|
224
|
+
- spec/models/filter_expressions_spec.rb
|
225
|
+
- spec/models/button_spec.rb
|
226
|
+
- spec/models/notification_all_of_android_background_layout_spec.rb
|
227
|
+
- spec/models/inline_response4001_spec.rb
|
228
|
+
- spec/models/operator_spec.rb
|
229
|
+
- spec/models/inline_response2005_spec.rb
|
230
|
+
- spec/models/export_players_request_body_spec.rb
|
231
|
+
- spec/models/inline_response2004_spec.rb
|
232
|
+
- spec/models/notification_slice_spec.rb
|
233
|
+
- spec/models/notification_all_of_spec.rb
|
234
|
+
- spec/models/purchase_spec.rb
|
235
|
+
- spec/models/app_spec.rb
|
236
|
+
- spec/models/inline_response4002_spec.rb
|
237
|
+
- spec/models/inline_response200_spec.rb
|
238
|
+
- spec/models/inline_response201_spec.rb
|
239
|
+
- spec/models/filter_spec.rb
|
240
|
+
- spec/models/platform_delivery_data_spec.rb
|
241
|
+
- spec/models/inline_response409_spec.rb
|
242
|
+
- spec/models/inline_response400_spec.rb
|
243
|
+
- spec/spec_helper.rb
|
data/.gitignore
DELETED
data/.rubocop.yml
DELETED
data/.travis.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache: bundler
|
3
|
-
|
4
|
-
rvm:
|
5
|
-
- 2.0.0
|
6
|
-
- 2.1.0
|
7
|
-
- 2.2.0
|
8
|
-
- 2.3.0
|
9
|
-
|
10
|
-
before_install:
|
11
|
-
- gem install bundler -v 1.11.2
|
12
|
-
|
13
|
-
notifications:
|
14
|
-
slack:
|
15
|
-
rooms:
|
16
|
-
secure: Gr8OCGVXegUFZmA0GYQnvAMs6cei1139C7sce13VvcG1HulIvpidnobJuNghfTx44psQTYDptHpz8AVn+kChbsQ46+0zXdNgCq2t9fJAVzTlTGnsB5O28FjUUEJAppjztUeRPKJX+B284AHJ0ZM/Vw7upoJ9IPbJ9bpcr5Xbms8eF/iYmJcicZ7iZNkHET8PFKqQP4H4/ahBOHfiI150zys1Pjos66wRukss1K52i6cvGmMajx58aVxDdwrw8wksNOHFu7VuoThipNHTIFyzr39EdG+DDrrfDLkLtpcb4+3QFn3/XZO7WHNfubnUY2DQ9xZrn8mUgIBFx6bVbcZ+xt/eh+4h5cDQyeEFY3GI+GiWJBDQa8VS69+CZQqEAvBNzHMPAkp19DZt0KFPEQqNG7KwXwuMx/kVsbnDhSGGN7d1Dc2m1XXVHViOUS6YePPzwjOZ3B7MTtb4FFSnsDeYvFFeBxqkX7a25L4llR9AcBMMxgCHDJi070qr3bOoQv9Qwi/Xw4P92ZLQ+VRoskzPRmbFcdfZxsI6R9orxJ1YgA/FGuQZAbmVQ3gZAWcW4iP1sgYh8EkOUH/c1c5tb03gC4OyU1R44L/FBBQiAXBCAl50PhJgCR13KrR6vxBnV/AIg+Pbk1uQPx4zqda4UbertMc+bB0M6EDV9OUPezb59Pk=
|
data/CHANGELOG.md
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# Change Log
|
2
|
-
All notable changes to this project will be documented in this file.
|
3
|
-
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
|
-
|
5
|
-
## [0.3.0] - 2016-05-10
|
6
|
-
### Added
|
7
|
-
* Models dynamically create attributes on initialization
|
8
|
-
|
9
|
-
## [0.2.0] - 2016-04-29
|
10
|
-
### Added
|
11
|
-
* Ruby 2.0 compatibility
|
12
|
-
* CHANGELOG
|
13
|
-
|
14
|
-
### Fixed
|
15
|
-
* Typos in README
|
16
|
-
|
17
|
-
## 0.1.0 - 2016-03-29
|
18
|
-
### Added
|
19
|
-
* Methods for all OneSignal resources
|
20
|
-
|
21
|
-
[0.3.0]: https://github.com/coding-chimp/onesignal/compare/v0.2.0...v0.3.0
|
22
|
-
[0.2.0]: https://github.com/coding-chimp/onesignal/compare/v0.1.0...v0.2.0
|
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
# Contributor Code of Conduct
|
2
|
-
|
3
|
-
As contributors and maintainers of this project, and in the interest of
|
4
|
-
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
-
contribute through reporting issues, posting feature requests, updating
|
6
|
-
documentation, submitting pull requests or patches, and other activities.
|
7
|
-
|
8
|
-
We are committed to making participation in this project a harassment-free
|
9
|
-
experience for everyone, regardless of level of experience, gender, gender
|
10
|
-
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
-
body size, race, ethnicity, age, religion, or nationality.
|
12
|
-
|
13
|
-
Examples of unacceptable behavior by participants include:
|
14
|
-
|
15
|
-
* The use of sexualized language or imagery
|
16
|
-
* Personal attacks
|
17
|
-
* Trolling or insulting/derogatory comments
|
18
|
-
* Public or private harassment
|
19
|
-
* Publishing other's private information, such as physical or electronic
|
20
|
-
addresses, without explicit permission
|
21
|
-
* Other unethical or unprofessional conduct
|
22
|
-
|
23
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
-
threatening, offensive, or harmful.
|
28
|
-
|
29
|
-
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
-
fairly and consistently applying these principles to every aspect of managing
|
31
|
-
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
-
Conduct may be permanently removed from the project team.
|
33
|
-
|
34
|
-
This code of conduct applies both within project spaces and in public spaces
|
35
|
-
when an individual is representing the project or its community.
|
36
|
-
|
37
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
-
reported by contacting a project maintainer at babartmann@gmail.com. All
|
39
|
-
complaints will be reviewed and investigated and will result in a response that
|
40
|
-
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
-
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
-
incident.
|
43
|
-
|
44
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
-
version 1.3.0, available at
|
46
|
-
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
-
|
48
|
-
[homepage]: http://contributor-covenant.org
|
49
|
-
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2016 Bastian Bartmann
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
require 'onesignal'
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require 'irb'
|
14
|
-
IRB.start
|
data/bin/setup
DELETED
data/lib/onesignal/client.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
module OneSignal
|
2
|
-
class Client
|
3
|
-
BASE_URL = 'https://onesignal.com/api/v1'.freeze
|
4
|
-
|
5
|
-
attr_reader :auth_token, :app_id
|
6
|
-
|
7
|
-
def initialize(auth_token: nil, app_id: nil)
|
8
|
-
@auth_token = auth_token
|
9
|
-
@app_id = app_id
|
10
|
-
|
11
|
-
ensure_auth_token_presence
|
12
|
-
end
|
13
|
-
|
14
|
-
def apps
|
15
|
-
@apps ||= AppResource.new(self)
|
16
|
-
end
|
17
|
-
|
18
|
-
def players
|
19
|
-
ensure_app_id_presence
|
20
|
-
|
21
|
-
@players ||= PlayerResource.new(self)
|
22
|
-
end
|
23
|
-
|
24
|
-
def notifications
|
25
|
-
ensure_app_id_presence
|
26
|
-
|
27
|
-
@notifications ||= NotificationResource.new(self)
|
28
|
-
end
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
def ensure_auth_token_presence
|
33
|
-
if auth_token.nil?
|
34
|
-
raise ArgumentError, 'missing keyword: auth_token'
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def ensure_app_id_presence
|
39
|
-
if app_id.nil?
|
40
|
-
raise AppIdMissingError
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
module OneSignal
|
2
|
-
class BaseModel
|
3
|
-
def self.to_proc
|
4
|
-
method(:new).to_proc
|
5
|
-
end
|
6
|
-
|
7
|
-
def initialize(attributes = {})
|
8
|
-
attributes.each do |key, value|
|
9
|
-
create_attr(key)
|
10
|
-
send("#{key}=", value)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def inspect
|
15
|
-
values = Hash[
|
16
|
-
instance_variables.map { |name| [name, instance_variable_get(name)] }
|
17
|
-
]
|
18
|
-
|
19
|
-
"<#{self.class.name} #{values}>"
|
20
|
-
end
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
def create_attr(name)
|
25
|
-
create_method("#{name}=".to_sym) do |value|
|
26
|
-
instance_variable_set("@#{name}", value)
|
27
|
-
end
|
28
|
-
|
29
|
-
create_method(name.to_sym) do
|
30
|
-
instance_variable_get("@#{name}")
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def create_method(name, &block)
|
35
|
-
unless respond_to?(name)
|
36
|
-
self.class.send(:define_method, name, &block)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
data/lib/onesignal/request.rb
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
require 'net/http'
|
2
|
-
|
3
|
-
module OneSignal
|
4
|
-
class Request
|
5
|
-
def initialize(client)
|
6
|
-
@client = client
|
7
|
-
end
|
8
|
-
|
9
|
-
def get(path, params = {})
|
10
|
-
uri = uri(path)
|
11
|
-
|
12
|
-
if @client.app_id
|
13
|
-
params[:app_id] = @client.app_id
|
14
|
-
end
|
15
|
-
|
16
|
-
uri.query = URI.encode_www_form(params)
|
17
|
-
|
18
|
-
request(uri, Net::HTTP::Get)
|
19
|
-
end
|
20
|
-
|
21
|
-
def post(path, params)
|
22
|
-
uri = uri(path)
|
23
|
-
request(uri, Net::HTTP::Post, params)
|
24
|
-
end
|
25
|
-
|
26
|
-
def put(path, params)
|
27
|
-
uri = uri(path)
|
28
|
-
request(uri, Net::HTTP::Put, params)
|
29
|
-
end
|
30
|
-
|
31
|
-
def delete(path, params = {})
|
32
|
-
uri = uri(path)
|
33
|
-
|
34
|
-
if @client.app_id
|
35
|
-
params[:app_id] = @client.app_id
|
36
|
-
end
|
37
|
-
|
38
|
-
uri.query = URI.encode_www_form(params)
|
39
|
-
|
40
|
-
request(uri, Net::HTTP::Delete, params)
|
41
|
-
end
|
42
|
-
|
43
|
-
private
|
44
|
-
|
45
|
-
def uri(path)
|
46
|
-
URI.parse(OneSignal::Client::BASE_URL + path)
|
47
|
-
end
|
48
|
-
|
49
|
-
def request(uri, klass, params = nil)
|
50
|
-
request = klass.new(uri.request_uri)
|
51
|
-
|
52
|
-
if params && @client.app_id
|
53
|
-
params[:app_id] = @client.app_id
|
54
|
-
end
|
55
|
-
|
56
|
-
if params
|
57
|
-
request.body = params.to_json
|
58
|
-
end
|
59
|
-
|
60
|
-
response = make_request(uri, request)
|
61
|
-
|
62
|
-
ensure_success(response, uri, params)
|
63
|
-
|
64
|
-
response
|
65
|
-
end
|
66
|
-
|
67
|
-
def make_request(uri, request)
|
68
|
-
add_headers(request)
|
69
|
-
http = http_object(uri)
|
70
|
-
http.request(request)
|
71
|
-
end
|
72
|
-
|
73
|
-
def add_headers(request)
|
74
|
-
request.add_field('Content-Type', 'application/json')
|
75
|
-
request.add_field('Authorization', "Basic #{@client.auth_token}")
|
76
|
-
end
|
77
|
-
|
78
|
-
def http_object(uri)
|
79
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
80
|
-
http.use_ssl = true
|
81
|
-
http.open_timeout = 30
|
82
|
-
http.read_timeout = 30
|
83
|
-
|
84
|
-
http
|
85
|
-
end
|
86
|
-
|
87
|
-
def ensure_success(response, uri, params = nil)
|
88
|
-
if response.code != '200'
|
89
|
-
message = "OneSignal error - uri: #{uri} - params: #{params}"
|
90
|
-
raise RequestError.new(message, response.code, response.body)
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module OneSignal
|
2
|
-
class RequestError < StandardError
|
3
|
-
attr_reader :http_status
|
4
|
-
attr_reader :http_body
|
5
|
-
|
6
|
-
def initialize(message, http_status, http_body)
|
7
|
-
@http_status = http_status
|
8
|
-
@http_body = http_body
|
9
|
-
|
10
|
-
if @http_status
|
11
|
-
message += " - http status : #{@http_status}"
|
12
|
-
end
|
13
|
-
|
14
|
-
if @http_body
|
15
|
-
message += " - http body : #{@http_body}"
|
16
|
-
end
|
17
|
-
|
18
|
-
super(message)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|