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.
Files changed (141) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +6 -1
  3. data/README.md +126 -111
  4. data/Rakefile +8 -8
  5. data/docs/App.md +76 -0
  6. data/docs/Button.md +22 -0
  7. data/docs/DefaultApi.md +1394 -0
  8. data/docs/DeliveryData.md +26 -0
  9. data/docs/ExportPlayersRequestBody.md +22 -0
  10. data/docs/Filter.md +24 -0
  11. data/docs/FilterExpressions.md +26 -0
  12. data/docs/FilterNotificationTarget.md +40 -0
  13. data/docs/GetNotificationRequestBody.md +22 -0
  14. data/docs/InlineResponse200.md +24 -0
  15. data/docs/InlineResponse2001.md +18 -0
  16. data/docs/InlineResponse2002.md +20 -0
  17. data/docs/InlineResponse2003.md +18 -0
  18. data/docs/InlineResponse2004.md +20 -0
  19. data/docs/InlineResponse2005.md +18 -0
  20. data/docs/InlineResponse201.md +20 -0
  21. data/docs/InlineResponse400.md +18 -0
  22. data/docs/InlineResponse4001.md +20 -0
  23. data/docs/InlineResponse4002.md +18 -0
  24. data/docs/InlineResponse409.md +20 -0
  25. data/docs/Notification.md +240 -0
  26. data/docs/NotificationAllOf.md +192 -0
  27. data/docs/NotificationAllOfAndroidBackgroundLayout.md +22 -0
  28. data/docs/NotificationSlice.md +24 -0
  29. data/docs/NotificationTarget.md +64 -0
  30. data/docs/Operator.md +18 -0
  31. data/docs/OutcomeData.md +22 -0
  32. data/docs/PlatformDeliveryData.md +28 -0
  33. data/docs/Player.md +70 -0
  34. data/docs/PlayerNotificationTarget.md +36 -0
  35. data/docs/PlayerSlice.md +24 -0
  36. data/docs/Purchase.md +22 -0
  37. data/docs/Segment.md +22 -0
  38. data/docs/SegmentNotificationTarget.md +20 -0
  39. data/docs/StringMap.md +102 -0
  40. data/docs/UpdatePlayerTagsRequestBody.md +18 -0
  41. data/git_push.sh +58 -0
  42. data/lib/OneSignal.rb +75 -0
  43. data/lib/onesignal/api/default_api.rb +1338 -0
  44. data/lib/onesignal/api_client.rb +391 -0
  45. data/lib/onesignal/api_error.rb +57 -0
  46. data/lib/onesignal/configuration.rb +242 -0
  47. data/lib/onesignal/models/app.rb +519 -13
  48. data/lib/onesignal/models/button.rb +241 -0
  49. data/lib/onesignal/models/delivery_data.rb +254 -0
  50. data/lib/onesignal/models/export_players_request_body.rb +241 -0
  51. data/lib/onesignal/models/filter.rb +293 -0
  52. data/lib/onesignal/models/filter_expressions.rb +335 -0
  53. data/lib/onesignal/models/filter_notification_target.rb +329 -0
  54. data/lib/onesignal/models/get_notification_request_body.rb +272 -0
  55. data/lib/onesignal/models/inline_response200.rb +256 -0
  56. data/lib/onesignal/models/inline_response2001.rb +218 -0
  57. data/lib/onesignal/models/inline_response2002.rb +227 -0
  58. data/lib/onesignal/models/inline_response2003.rb +218 -0
  59. data/lib/onesignal/models/inline_response2004.rb +227 -0
  60. data/lib/onesignal/models/inline_response2005.rb +218 -0
  61. data/lib/onesignal/models/inline_response201.rb +228 -0
  62. data/lib/onesignal/models/inline_response400.rb +220 -0
  63. data/lib/onesignal/models/inline_response4001.rb +229 -0
  64. data/lib/onesignal/models/inline_response4002.rb +220 -0
  65. data/lib/onesignal/models/inline_response409.rb +229 -0
  66. data/lib/onesignal/models/notification.rb +1395 -5
  67. data/lib/onesignal/models/notification_all_of.rb +1124 -0
  68. data/lib/onesignal/models/notification_all_of_android_background_layout.rb +240 -0
  69. data/lib/onesignal/models/notification_slice.rb +247 -0
  70. data/lib/onesignal/models/notification_target.rb +494 -0
  71. data/lib/onesignal/models/operator.rb +253 -0
  72. data/lib/onesignal/models/outcome_data.rb +285 -0
  73. data/lib/onesignal/models/platform_delivery_data.rb +264 -0
  74. data/lib/onesignal/models/player.rb +483 -9
  75. data/lib/onesignal/models/player_notification_target.rb +329 -0
  76. data/lib/onesignal/models/player_slice.rb +247 -0
  77. data/lib/onesignal/models/purchase.rb +254 -0
  78. data/lib/onesignal/models/segment.rb +251 -0
  79. data/lib/onesignal/models/segment_notification_target.rb +233 -0
  80. data/lib/onesignal/models/string_map.rb +644 -0
  81. data/lib/onesignal/models/update_player_tags_request_body.rb +219 -0
  82. data/lib/onesignal/version.rb +13 -1
  83. data/onesignal.gemspec +36 -27
  84. data/spec/api/default_api_spec.rb +285 -0
  85. data/spec/api_client_spec.rb +226 -0
  86. data/spec/configuration_spec.rb +42 -0
  87. data/spec/models/app_spec.rb +212 -0
  88. data/spec/models/button_spec.rb +46 -0
  89. data/spec/models/delivery_data_spec.rb +58 -0
  90. data/spec/models/export_players_request_body_spec.rb +46 -0
  91. data/spec/models/filter_expressions_spec.rb +66 -0
  92. data/spec/models/filter_notification_target_spec.rb +100 -0
  93. data/spec/models/filter_spec.rb +56 -0
  94. data/spec/models/get_notification_request_body_spec.rb +50 -0
  95. data/spec/models/inline_response2001_spec.rb +34 -0
  96. data/spec/models/inline_response2002_spec.rb +40 -0
  97. data/spec/models/inline_response2003_spec.rb +34 -0
  98. data/spec/models/inline_response2004_spec.rb +40 -0
  99. data/spec/models/inline_response2005_spec.rb +34 -0
  100. data/spec/models/inline_response200_spec.rb +52 -0
  101. data/spec/models/inline_response201_spec.rb +40 -0
  102. data/spec/models/inline_response4001_spec.rb +40 -0
  103. data/spec/models/inline_response4002_spec.rb +34 -0
  104. data/spec/models/inline_response400_spec.rb +34 -0
  105. data/spec/models/inline_response409_spec.rb +40 -0
  106. data/spec/models/notification_all_of_android_background_layout_spec.rb +46 -0
  107. data/spec/models/notification_all_of_spec.rb +560 -0
  108. data/spec/models/notification_slice_spec.rb +52 -0
  109. data/spec/models/notification_spec.rb +704 -0
  110. data/spec/models/notification_target_spec.rb +172 -0
  111. data/spec/models/operator_spec.rb +38 -0
  112. data/spec/models/outcome_data_spec.rb +50 -0
  113. data/spec/models/platform_delivery_data_spec.rb +64 -0
  114. data/spec/models/player_notification_target_spec.rb +88 -0
  115. data/spec/models/player_slice_spec.rb +52 -0
  116. data/spec/models/player_spec.rb +190 -0
  117. data/spec/models/purchase_spec.rb +46 -0
  118. data/spec/models/segment_notification_target_spec.rb +40 -0
  119. data/spec/models/segment_spec.rb +46 -0
  120. data/spec/models/string_map_spec.rb +286 -0
  121. data/spec/models/update_player_tags_request_body_spec.rb +34 -0
  122. data/spec/spec_helper.rb +111 -0
  123. metadata +182 -65
  124. data/.gitignore +0 -10
  125. data/.rubocop.yml +0 -17
  126. data/.travis.yml +0 -16
  127. data/CHANGELOG.md +0 -22
  128. data/CODE_OF_CONDUCT.md +0 -49
  129. data/LICENSE +0 -21
  130. data/bin/console +0 -14
  131. data/bin/setup +0 -8
  132. data/lib/onesignal/app_id_missing_error.rb +0 -7
  133. data/lib/onesignal/client.rb +0 -44
  134. data/lib/onesignal/models/base_model.rb +0 -40
  135. data/lib/onesignal/request.rb +0 -94
  136. data/lib/onesignal/request_error.rb +0 -21
  137. data/lib/onesignal/resources/app_resource.rb +0 -27
  138. data/lib/onesignal/resources/base_resource.rb +0 -35
  139. data/lib/onesignal/resources/notification_resource.rb +0 -33
  140. data/lib/onesignal/resources/player_resource.rb +0 -53
  141. data/lib/onesignal.rb +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0d3ca7d6cbaf4ccca38afdf280d06402bc5249ba
4
- data.tar.gz: fe9bd8ead86744e0c1e2a7abc955645d58681a55
2
+ SHA256:
3
+ metadata.gz: d21c45ad6dc835a3d618d705c0abad6b42cb5d81733232519ff6305f444736cd
4
+ data.tar.gz: cb84fa7dcfbf2dbbce153806f056f059587aa45fda020451f2df01ffe496b235
5
5
  SHA512:
6
- metadata.gz: de637cf8ca145013e3d15e839a65ce44c96c829e3ae85fea3398c5748f897b414ea12966142f1b281eef8ba107723ddfc8005bc31651a69760fd151c725ee277
7
- data.tar.gz: 0cdbbc1d1a4814a2a678f45f57eb6649a6cba7743af3d1306e7e8bcfc98860148fcc08e9d0bc3a148c4a66b52799c98a8513248e3bcb07679e38f2e09bd7a40e
6
+ metadata.gz: 798df78ec20c50fddf2cc396900b83209d684e15f4a978b1c15a2a6fe33eb8b6bd33c149806a3984bc837ce79e4610da405d1774252cd4f8c7261b96846c3d39
7
+ data.tar.gz: 2091ac298b863f0658ecb69eb20009231216f4ad4a044a55ee67f356ea0d19038953ebfdbffc28731cb110e58ac8a4ede9b8f5f411904ef5e86bda9f2abb9549
data/Gemfile CHANGED
@@ -1,4 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in onesignal.gemspec
4
3
  gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 13.0.1'
7
+ gem 'pry-byebug'
8
+ gem 'rubocop', '~> 0.66.0'
9
+ end
data/README.md CHANGED
@@ -1,141 +1,156 @@
1
- # OneSignal
1
+ # onesignal
2
2
 
3
- [![Gem Version][rgb]][rgl] [![Build Status][trb]][trl] [![Code Climate][ccb]][ccl]
3
+ OneSignal - the Ruby gem for the OneSignal
4
4
 
5
- OneSignal is a simple ruby wrapper for the [OneSignal API][osa].
5
+ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
6
6
 
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'onesignal'
13
- ```
14
-
15
- And then execute:
7
+ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
16
8
 
17
- $ bundle
9
+ - API version: 1.0.0
10
+ - Package version: 1.0.0
11
+ - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
+ For more information, please visit [https://onesignal.com](https://onesignal.com)
18
13
 
19
- Or install it yourself as:
20
-
21
- $ gem install onesignal
14
+ ## Installation
22
15
 
23
- ## Usage
16
+ ### Build a gem
24
17
 
25
- You can find your auth keys and app IDs on the Account Management page when
26
- you're logged into OneSignal. With those at hand, you can create a client.
18
+ To build the Ruby code into a gem:
27
19
 
28
- ```ruby
29
- client = OneSignal::Client.new(auth_token: 'AUTH_TOKEN', app_id: 'APP_ID')
20
+ ```shell
21
+ gem build onesignal.gemspec
30
22
  ```
31
23
 
32
- ### Design
33
-
34
- This gem follows a strict design of resources as methods on your client. For
35
- examples, for apps, you will call your client like this:
24
+ Then either install the gem locally:
36
25
 
37
- ```ruby
38
- client = OneSignal::Client.new(auth_token: 'AUTH_TOKEN')
39
- client.apps #=> AppResource
26
+ ```shell
27
+ gem install ./onesignal-1.0.0.gem
40
28
  ```
41
29
 
42
- It will return objects that contain the information provided by the API. For
43
- example:
30
+ (for development, run `gem install --dev ./onesignal-1.0.0.gem` to install the development dependencies)
44
31
 
45
- ```ruby
46
- client = OneSignal::Client.new(auth_token: 'AUTH_TOKEN')
47
- client.apps.all
48
- # => [ OneSignal::App(id: '92911750-242d-4260-9e00-9d9034f139ce', name: 'Your App 1', ...), OneSignal::App(id: 'e4e87830-b954-11e3-811d-f3b376925f15', name: Your app 2', ...) ]
49
- ```
32
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
50
33
 
51
- To retrieve objects, you can perform this type of action on the resource (if
52
- the API supports it):
34
+ Finally add this to the Gemfile:
53
35
 
54
- ```ruby
55
- client = OneSignal::Client.new(auth_token: 'AUTH_TOKEN')
56
- app = client.apps.find(id: 'e4e87830-b954-11e3-811d-f3b376925f15')
57
- # => OneSignal::App(id: 'e4e87830-b954-11e3-811d-f3b376925f15', name: 'Your app', ...)
58
- ```
36
+ gem 'onesignal', '~> 1.0.0'
59
37
 
60
- To create objects, you just have to build a params hash and pass it to the
61
- action on the resource:
38
+ ### Install from Git
62
39
 
63
- ```ruby
64
- client = OneSignal::Client.new(auth_token: 'AUTH_TOKEN')
65
- params = { name: 'Your app', apns_env: 'sandbox', ... }
66
- app = client.apps.create(params)
67
- # => OneSignal::App(id: 'e4e87830-b954-11e3-811d-f3b376925f15', name: 'Your app', ...)
68
- ```
69
-
70
- ### All Resources and actions
71
-
72
- #### App resource
73
-
74
- ```ruby
75
- client = OneSignal::Client.new(auth_token: 'AUTH_TOKEN')
76
- client.apps #=> OneSignal::AppResource
77
- ```
40
+ If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
78
41
 
79
- Actions supported:
42
+ gem 'onesignal', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
80
43
 
81
- * `client.apps.all`
82
- * `client.apps.find(id)`
83
- * `client.apps.create(params)`
84
- * `client.apps.update(id, params)`
44
+ ### Include the Ruby code directly
85
45
 
86
- #### Player resource
46
+ Include the Ruby code directly using `-I` as follows:
87
47
 
88
- ```ruby
89
- client = OneSignal::Client.new(auth_token: 'AUTH_TOKEN', app_id: 'APP_ID')
90
- client.players #=> OneSignal::PlayerResource
48
+ ```shell
49
+ ruby -Ilib script.rb
91
50
  ```
92
51
 
93
- Actions supported:
94
-
95
- * `client.players.all`
96
- * `client.players.all(params)`
97
- * `client.players.find(id)`
98
- * `client.players.create(params)`
99
- * `client.players.update(id, params)`
100
- * `client.players.on_session(id, params)`
101
- * `client.players.on_purchase(id, params)`
102
- * `client.players.on_focus(id, params)`
103
- * `client.players.csv_export(id)`
52
+ ## Getting Started
104
53
 
105
- #### Notification resource
54
+ Please follow the [installation](#installation) procedure and then run the following code:
106
55
 
107
56
  ```ruby
108
- client = OneSignal::Client.new(auth_token: 'AUTH_TOKEN', app_id: 'APP_ID')
109
- client.notifications #=> OneSignal::NotificationResource
110
- ```
111
-
112
- Actions supported:
113
-
114
- * `client.notifications.all`
115
- * `client.notifications.all(params)`
116
- * `client.notifications.find(id)`
117
- * `client.notifications.track_open(id, params)`
118
- * `client.notifications.create(params)`
119
- * `client.notifications.cancel(id)`
120
-
121
- ## Contributing
57
+ # Load the gem
58
+ require 'onesignal'
59
+
60
+ # Setup authorization
61
+ OneSignal.configure do |config|
62
+ # Configure Bearer authorization: app_key
63
+ config.access_token = 'YOUR_BEARER_TOKEN'
64
+ end
65
+
66
+ api_instance = OneSignal::DefaultApi.new
67
+ app_id = 'app_id_example' # String |
68
+ notification_id = 'notification_id_example' # String |
69
+
70
+ begin
71
+ #Stop a scheduled or currently outgoing notification
72
+ result = api_instance.cancel_notification(app_id, notification_id)
73
+ p result
74
+ rescue OneSignal::ApiError => e
75
+ puts "Exception when calling DefaultApi->cancel_notification: #{e}"
76
+ end
122
77
 
123
- Bug reports and pull requests are welcome on [GitHub][gh].
124
-
125
- This project is intended to be a safe, welcoming space for collaboration, and
126
- contributors are expected to adhere to the [Contributor Covenant][cc] code of conduct.
127
-
128
- ## License
78
+ ```
129
79
 
130
- The gem is available as open source under the terms of the [MIT License][mit].
80
+ ## Documentation for API Endpoints
81
+
82
+ All URIs are relative to *https://onesignal.com/api/v1*
83
+
84
+ Class | Method | HTTP request | Description
85
+ ------------ | ------------- | ------------- | -------------
86
+ *OneSignal::DefaultApi* | [**cancel_notification**](docs/DefaultApi.md#cancel_notification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification
87
+ *OneSignal::DefaultApi* | [**create_app**](docs/DefaultApi.md#create_app) | **POST** /apps | Create an app
88
+ *OneSignal::DefaultApi* | [**create_notification**](docs/DefaultApi.md#create_notification) | **POST** /notifications | Create notification
89
+ *OneSignal::DefaultApi* | [**create_player**](docs/DefaultApi.md#create_player) | **POST** /players | Add a device
90
+ *OneSignal::DefaultApi* | [**create_segments**](docs/DefaultApi.md#create_segments) | **POST** /apps/{app_id}/segments | Create Segments
91
+ *OneSignal::DefaultApi* | [**delete_player**](docs/DefaultApi.md#delete_player) | **DELETE** /players/{player_id} | Delete a user record
92
+ *OneSignal::DefaultApi* | [**delete_segments**](docs/DefaultApi.md#delete_segments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments
93
+ *OneSignal::DefaultApi* | [**export_players**](docs/DefaultApi.md#export_players) | **POST** /players/csv_export?app_id={app_id} | CSV export
94
+ *OneSignal::DefaultApi* | [**get_app**](docs/DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app
95
+ *OneSignal::DefaultApi* | [**get_apps**](docs/DefaultApi.md#get_apps) | **GET** /apps | View apps
96
+ *OneSignal::DefaultApi* | [**get_notification**](docs/DefaultApi.md#get_notification) | **GET** /notifications/{notification_id} | View notification
97
+ *OneSignal::DefaultApi* | [**get_notification_history**](docs/DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History
98
+ *OneSignal::DefaultApi* | [**get_notifications**](docs/DefaultApi.md#get_notifications) | **GET** /notifications | View notifications
99
+ *OneSignal::DefaultApi* | [**get_outcomes**](docs/DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes
100
+ *OneSignal::DefaultApi* | [**get_player**](docs/DefaultApi.md#get_player) | **GET** /players/{player_id} | View device
101
+ *OneSignal::DefaultApi* | [**get_players**](docs/DefaultApi.md#get_players) | **GET** /players | View devices
102
+ *OneSignal::DefaultApi* | [**update_app**](docs/DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app
103
+ *OneSignal::DefaultApi* | [**update_player**](docs/DefaultApi.md#update_player) | **PUT** /players/{player_id} | Edit device
104
+ *OneSignal::DefaultApi* | [**update_player_tags**](docs/DefaultApi.md#update_player_tags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id
105
+
106
+
107
+ ## Documentation for Models
108
+
109
+ - [OneSignal::App](docs/App.md)
110
+ - [OneSignal::Button](docs/Button.md)
111
+ - [OneSignal::DeliveryData](docs/DeliveryData.md)
112
+ - [OneSignal::ExportPlayersRequestBody](docs/ExportPlayersRequestBody.md)
113
+ - [OneSignal::Filter](docs/Filter.md)
114
+ - [OneSignal::FilterExpressions](docs/FilterExpressions.md)
115
+ - [OneSignal::FilterNotificationTarget](docs/FilterNotificationTarget.md)
116
+ - [OneSignal::GetNotificationRequestBody](docs/GetNotificationRequestBody.md)
117
+ - [OneSignal::InlineResponse200](docs/InlineResponse200.md)
118
+ - [OneSignal::InlineResponse2001](docs/InlineResponse2001.md)
119
+ - [OneSignal::InlineResponse2002](docs/InlineResponse2002.md)
120
+ - [OneSignal::InlineResponse2003](docs/InlineResponse2003.md)
121
+ - [OneSignal::InlineResponse2004](docs/InlineResponse2004.md)
122
+ - [OneSignal::InlineResponse2005](docs/InlineResponse2005.md)
123
+ - [OneSignal::InlineResponse201](docs/InlineResponse201.md)
124
+ - [OneSignal::InlineResponse400](docs/InlineResponse400.md)
125
+ - [OneSignal::InlineResponse4001](docs/InlineResponse4001.md)
126
+ - [OneSignal::InlineResponse4002](docs/InlineResponse4002.md)
127
+ - [OneSignal::InlineResponse409](docs/InlineResponse409.md)
128
+ - [OneSignal::Notification](docs/Notification.md)
129
+ - [OneSignal::NotificationAllOf](docs/NotificationAllOf.md)
130
+ - [OneSignal::NotificationAllOfAndroidBackgroundLayout](docs/NotificationAllOfAndroidBackgroundLayout.md)
131
+ - [OneSignal::NotificationSlice](docs/NotificationSlice.md)
132
+ - [OneSignal::NotificationTarget](docs/NotificationTarget.md)
133
+ - [OneSignal::Operator](docs/Operator.md)
134
+ - [OneSignal::OutcomeData](docs/OutcomeData.md)
135
+ - [OneSignal::PlatformDeliveryData](docs/PlatformDeliveryData.md)
136
+ - [OneSignal::Player](docs/Player.md)
137
+ - [OneSignal::PlayerNotificationTarget](docs/PlayerNotificationTarget.md)
138
+ - [OneSignal::PlayerSlice](docs/PlayerSlice.md)
139
+ - [OneSignal::Purchase](docs/Purchase.md)
140
+ - [OneSignal::Segment](docs/Segment.md)
141
+ - [OneSignal::SegmentNotificationTarget](docs/SegmentNotificationTarget.md)
142
+ - [OneSignal::StringMap](docs/StringMap.md)
143
+ - [OneSignal::UpdatePlayerTagsRequestBody](docs/UpdatePlayerTagsRequestBody.md)
144
+
145
+
146
+ ## Documentation for Authorization
147
+
148
+
149
+ ### app_key
150
+
151
+ - **Type**: Bearer authentication
152
+
153
+ ### user_key
154
+
155
+ - **Type**: Bearer authentication
131
156
 
132
- [rgb]: https://img.shields.io/gem/v/onesignal.svg
133
- [rgl]: https://rubygems.org/gems/onesignal
134
- [trb]: https://travis-ci.org/coding-chimp/onesignal.svg?branch=master
135
- [trl]: https://travis-ci.org/coding-chimp/onesignal
136
- [ccb]: https://codeclimate.com/github/coding-chimp/onesignal/badges/gpa.svg
137
- [ccl]: https://codeclimate.com/github/coding-chimp/onesignal
138
- [osa]: https://documentation.onesignal.com/docs/server-api-overview
139
- [cc]: http://contributor-covenant.org
140
- [gh]: https://github.com/coding-chimp/onesignal
141
- [mit]: http://opensource.org/licenses/MIT
data/Rakefile CHANGED
@@ -1,10 +1,10 @@
1
- require 'bundler/gem_tasks'
2
- require 'rake/testtask'
1
+ require "bundler/gem_tasks"
3
2
 
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << 'test'
6
- t.libs << 'lib'
7
- t.test_files = FileList['test/**/*_test.rb']
8
- end
3
+ begin
4
+ require 'rspec/core/rake_task'
9
5
 
10
- task default: :test
6
+ RSpec::Core::RakeTask.new(:spec)
7
+ task default: :spec
8
+ rescue LoadError
9
+ # no rspec available
10
+ end
data/docs/App.md ADDED
@@ -0,0 +1,76 @@
1
+ # OneSignal::App
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | [readonly] |
8
+ | **name** | **String** | The name of your app, as displayed on your apps list on the dashboard. This can be renamed. | [optional] |
9
+ | **players** | **Integer** | | [optional][readonly] |
10
+ | **messageable_players** | **Integer** | | [optional][readonly] |
11
+ | **updated_at** | **Time** | | [optional][readonly] |
12
+ | **created_at** | **Time** | | [optional][readonly] |
13
+ | **android_gcm_sender_id** | **String** | Android: Your Google Project number. Also known as Sender ID. | [optional] |
14
+ | **gcm_key** | **String** | Android: Your Google Push Messaging Auth Key | [optional] |
15
+ | **chrome_web_origin** | **String** | Chrome (All Browsers except Safari) (Recommended): The URL to your website. This field is required if you wish to enable web push and specify other web push parameters. | [optional] |
16
+ | **chrome_key** | **String** | Not for web push. Your Google Push Messaging Auth Key if you use Chrome Apps / Extensions. | [optional] |
17
+ | **chrome_web_default_notification_icon** | **String** | Chrome (All Browsers except Safari): Your default notification icon. Should be 256x256 pixels, min 80x80. | [optional] |
18
+ | **chrome_web_sub_domain** | **String** | Chrome (All Browsers except Safari): A subdomain of your choice in order to support Web Push on non-HTTPS websites. This field must be set in order for the chrome_web_gcm_sender_id property to be processed. | [optional] |
19
+ | **apns_env** | **String** | iOS: Either sandbox or production | [optional] |
20
+ | **apns_p12** | **String** | iOS: Your apple push notification p12 certificate file, converted to a string and Base64 encoded. | [optional] |
21
+ | **apns_p12_password** | **String** | iOS: Required if using p12 certificate. Password for the apns_p12 file. | [optional] |
22
+ | **apns_certificates** | **String** | | [optional][readonly] |
23
+ | **safari_apns_certificates** | **String** | | [optional][readonly] |
24
+ | **safari_apns_p12** | **String** | Safari: Your apple push notification p12 certificate file for Safari Push Notifications, converted to a string and Base64 encoded. | [optional] |
25
+ | **safari_apns_p12_password** | **String** | Safari: Password for safari_apns_p12 file | [optional] |
26
+ | **safari_site_origin** | **String** | Safari (Recommended): The hostname to your website including http(s):// | [optional] |
27
+ | **safari_push_id** | **String** | | [optional][readonly] |
28
+ | **safari_icon_16_16** | **String** | | [optional][readonly] |
29
+ | **safari_icon_32_32** | **String** | | [optional][readonly] |
30
+ | **safari_icon_64_64** | **String** | | [optional][readonly] |
31
+ | **safari_icon_128_128** | **String** | | [optional][readonly] |
32
+ | **safari_icon_256_256** | **String** | Safari: A url for a 256x256 png notification icon. This is the only Safari icon URL you need to provide. | [optional] |
33
+ | **site_name** | **String** | All Browsers (Recommended): The Site Name. Requires both chrome_web_origin and safari_site_origin to be set to add or update it. | [optional] |
34
+ | **basic_auth_key** | **String** | | [optional][readonly] |
35
+ | **organization_id** | **String** | The Id of the Organization you would like to add this app to. | [optional] |
36
+ | **additional_data_is_root_payload** | **Boolean** | iOS: Notification data (additional data) values will be added to the root of the apns payload when sent to the device. Ignore if you&#39;re not using any other plugins, or not using OneSignal SDK methods to read the payload. | [optional] |
37
+
38
+ ## Example
39
+
40
+ ```ruby
41
+ require 'onesignal'
42
+
43
+ instance = OneSignal::App.new(
44
+ id: null,
45
+ name: null,
46
+ players: null,
47
+ messageable_players: null,
48
+ updated_at: null,
49
+ created_at: null,
50
+ android_gcm_sender_id: null,
51
+ gcm_key: null,
52
+ chrome_web_origin: null,
53
+ chrome_key: null,
54
+ chrome_web_default_notification_icon: null,
55
+ chrome_web_sub_domain: null,
56
+ apns_env: null,
57
+ apns_p12: null,
58
+ apns_p12_password: null,
59
+ apns_certificates: null,
60
+ safari_apns_certificates: null,
61
+ safari_apns_p12: null,
62
+ safari_apns_p12_password: null,
63
+ safari_site_origin: null,
64
+ safari_push_id: null,
65
+ safari_icon_16_16: null,
66
+ safari_icon_32_32: null,
67
+ safari_icon_64_64: null,
68
+ safari_icon_128_128: null,
69
+ safari_icon_256_256: null,
70
+ site_name: null,
71
+ basic_auth_key: null,
72
+ organization_id: null,
73
+ additional_data_is_root_payload: null
74
+ )
75
+ ```
76
+
data/docs/Button.md ADDED
@@ -0,0 +1,22 @@
1
+ # OneSignal::Button
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | |
8
+ | **text** | **String** | | [optional] |
9
+ | **icon** | **String** | | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'onesignal'
15
+
16
+ instance = OneSignal::Button.new(
17
+ id: null,
18
+ text: null,
19
+ icon: null
20
+ )
21
+ ```
22
+