onesignal 1.0.0.beta1 → 1.0.1

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.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/LICENSE +24 -0
  4. data/README.md +75 -45
  5. data/RELEASE_INSTRUCTIONS.md +11 -0
  6. data/docs/DefaultApi.md +86 -86
  7. data/docs/InlineResponse200.md +1 -1
  8. data/docs/InlineResponse2001.md +1 -1
  9. data/docs/InlineResponse2002.md +1 -1
  10. data/docs/InlineResponse2005.md +4 -2
  11. data/docs/{InlineResponse2003.md → InlineResponse2007.md} +3 -3
  12. data/docs/InlineResponse2008.md +18 -0
  13. data/docs/InlineResponse4002.md +4 -2
  14. data/docs/InlineResponse4003.md +18 -0
  15. data/docs/InvalidIdentifierError.md +20 -0
  16. data/docs/Notification.md +12 -12
  17. data/docs/Notification200Errors.md +49 -0
  18. data/docs/NotificationAllOf.md +11 -11
  19. data/docs/NotificationSlice.md +1 -1
  20. data/docs/NotificationTarget.md +1 -1
  21. data/docs/NotificationWithMeta.md +260 -0
  22. data/docs/NotificationWithMetaAllOf.md +38 -0
  23. data/docs/OutcomesData.md +18 -0
  24. data/docs/Player.md +2 -2
  25. data/docs/PlayerNotificationTarget.md +1 -1
  26. data/docs/StringMap.md +1 -1
  27. data/lib/onesignal/api/default_api.rb +82 -55
  28. data/lib/onesignal/api_client.rb +9 -7
  29. data/lib/onesignal/api_error.rb +2 -2
  30. data/lib/onesignal/configuration.rb +6 -3
  31. data/lib/onesignal/models/app.rb +3 -2
  32. data/lib/onesignal/models/button.rb +3 -2
  33. data/lib/onesignal/models/delivery_data.rb +8 -2
  34. data/lib/onesignal/models/export_players_request_body.rb +3 -2
  35. data/lib/onesignal/models/filter.rb +3 -2
  36. data/lib/onesignal/models/filter_expressions.rb +3 -2
  37. data/lib/onesignal/models/filter_notification_target.rb +3 -2
  38. data/lib/onesignal/models/get_notification_request_body.rb +3 -2
  39. data/lib/onesignal/models/inline_response200.rb +4 -3
  40. data/lib/onesignal/models/inline_response2001.rb +4 -3
  41. data/lib/onesignal/models/inline_response2002.rb +4 -3
  42. data/lib/onesignal/models/inline_response2005.rb +19 -9
  43. data/lib/onesignal/models/{inline_response2003.rb → inline_response2007.rb} +7 -6
  44. data/lib/onesignal/models/{inline_response2004.rb → inline_response2008.rb} +13 -21
  45. data/lib/onesignal/models/inline_response201.rb +3 -2
  46. data/lib/onesignal/models/inline_response400.rb +3 -2
  47. data/lib/onesignal/models/inline_response4001.rb +3 -2
  48. data/lib/onesignal/models/inline_response4002.rb +20 -10
  49. data/lib/onesignal/models/{inline_response409.rb → inline_response4003.rb} +14 -22
  50. data/lib/onesignal/models/invalid_identifier_error.rb +234 -0
  51. data/lib/onesignal/models/notification.rb +39 -19
  52. data/lib/onesignal/models/notification200_errors.rb +105 -0
  53. data/lib/onesignal/models/notification_all_of.rb +38 -18
  54. data/lib/onesignal/models/notification_all_of_android_background_layout.rb +3 -2
  55. data/lib/onesignal/models/notification_slice.rb +4 -3
  56. data/lib/onesignal/models/notification_target.rb +4 -3
  57. data/lib/onesignal/models/notification_with_meta.rb +1526 -0
  58. data/lib/onesignal/models/notification_with_meta_all_of.rb +322 -0
  59. data/lib/onesignal/models/operator.rb +3 -2
  60. data/lib/onesignal/models/outcome_data.rb +3 -2
  61. data/lib/onesignal/models/outcomes_data.rb +221 -0
  62. data/lib/onesignal/models/platform_delivery_data.rb +3 -2
  63. data/lib/onesignal/models/player.rb +6 -8
  64. data/lib/onesignal/models/player_notification_target.rb +4 -3
  65. data/lib/onesignal/models/player_slice.rb +3 -2
  66. data/lib/onesignal/models/purchase.rb +3 -2
  67. data/lib/onesignal/models/segment.rb +3 -2
  68. data/lib/onesignal/models/segment_notification_target.rb +3 -2
  69. data/lib/onesignal/models/string_map.rb +3 -7
  70. data/lib/onesignal/models/update_player_tags_request_body.rb +3 -2
  71. data/lib/onesignal/version.rb +3 -3
  72. data/lib/{OneSignal.rb → onesignal.rb} +10 -5
  73. data/onesignal.gemspec +5 -4
  74. data/spec/api/default_api_spec.rb +20 -20
  75. data/spec/api_client_spec.rb +4 -4
  76. data/spec/configuration_spec.rb +2 -2
  77. data/spec/models/app_spec.rb +2 -2
  78. data/spec/models/button_spec.rb +2 -2
  79. data/spec/models/delivery_data_spec.rb +2 -2
  80. data/spec/models/export_players_request_body_spec.rb +2 -2
  81. data/spec/models/filter_expressions_spec.rb +2 -2
  82. data/spec/models/filter_notification_target_spec.rb +2 -2
  83. data/spec/models/filter_spec.rb +2 -2
  84. data/spec/models/get_notification_request_body_spec.rb +2 -2
  85. data/spec/models/inline_response2001_spec.rb +2 -2
  86. data/spec/models/inline_response2002_spec.rb +2 -2
  87. data/spec/models/inline_response2005_spec.rb +9 -3
  88. data/spec/models/{inline_response2003_spec.rb → inline_response2007_spec.rb} +8 -8
  89. data/spec/models/{inline_response409_spec.rb → inline_response2008_spec.rb} +9 -15
  90. data/spec/models/inline_response200_spec.rb +2 -2
  91. data/spec/models/inline_response201_spec.rb +2 -2
  92. data/spec/models/inline_response4001_spec.rb +2 -2
  93. data/spec/models/inline_response4002_spec.rb +9 -3
  94. data/spec/models/inline_response4003_spec.rb +34 -0
  95. data/spec/models/inline_response400_spec.rb +2 -2
  96. data/spec/models/{inline_response2004_spec.rb → invalid_identifier_error_spec.rb} +10 -10
  97. data/spec/models/notification200_errors_spec.rb +31 -0
  98. data/spec/models/notification_all_of_android_background_layout_spec.rb +2 -2
  99. data/spec/models/notification_all_of_spec.rb +3 -3
  100. data/spec/models/notification_slice_spec.rb +2 -2
  101. data/spec/models/notification_spec.rb +3 -3
  102. data/spec/models/notification_target_spec.rb +2 -2
  103. data/spec/models/notification_with_meta_all_of_spec.rb +94 -0
  104. data/spec/models/notification_with_meta_spec.rb +764 -0
  105. data/spec/models/operator_spec.rb +2 -2
  106. data/spec/models/outcome_data_spec.rb +2 -2
  107. data/spec/models/outcomes_data_spec.rb +34 -0
  108. data/spec/models/platform_delivery_data_spec.rb +2 -2
  109. data/spec/models/player_notification_target_spec.rb +2 -2
  110. data/spec/models/player_slice_spec.rb +2 -2
  111. data/spec/models/player_spec.rb +2 -2
  112. data/spec/models/purchase_spec.rb +2 -2
  113. data/spec/models/segment_notification_target_spec.rb +2 -2
  114. data/spec/models/segment_spec.rb +2 -2
  115. data/spec/models/string_map_spec.rb +2 -2
  116. data/spec/models/update_player_tags_request_body_spec.rb +2 -2
  117. data/spec/spec_helper.rb +2 -2
  118. metadata +51 -29
  119. data/docs/InlineResponse2004.md +0 -20
  120. data/docs/InlineResponse409.md +0 -20
  121. data/git_push.sh +0 -58
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d21c45ad6dc835a3d618d705c0abad6b42cb5d81733232519ff6305f444736cd
4
- data.tar.gz: cb84fa7dcfbf2dbbce153806f056f059587aa45fda020451f2df01ffe496b235
3
+ metadata.gz: 5ed573134bbb56b24a52664d42154e91205f9ea004d945816cece64b091f70a0
4
+ data.tar.gz: 9216667b6c7d0b68e7fd13556a27f88006bab0ed59747b3bf2e17a095c95afa3
5
5
  SHA512:
6
- metadata.gz: 798df78ec20c50fddf2cc396900b83209d684e15f4a978b1c15a2a6fe33eb8b6bd33c149806a3984bc837ce79e4610da405d1774252cd4f8c7261b96846c3d39
7
- data.tar.gz: 2091ac298b863f0658ecb69eb20009231216f4ad4a044a55ee67f356ea0d19038953ebfdbffc28731cb110e58ac8a4ede9b8f5f411904ef5e86bda9f2abb9549
6
+ metadata.gz: b57b8d0ed69672c664b0ec114576d702b0c601eef83e8c2db0a32d483a9bd79ecb5cfe27e442ede4785bd7fd18d039f4d3389487c20966ad22319f3198922dd5
7
+ data.tar.gz: d8f30f8aa642aab8150a908fc594d8c1c3e7e1f9da56999ed5b7f0c122682b741ab66c29f6beabe6c531b64c97c253ed062f9cf0c67794ee94e86cd6c7279972
data/CHANGELOG.md ADDED
@@ -0,0 +1,31 @@
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
+ ## [1.0.0.beta1] - 2021-10-13
6
+ ### Major Release
7
+ **INCLUDES BREAKING CHANGES**
8
+ This release is the code-generated Ruby client made with OpenAPI Generator.
9
+ The release is a complete overhaul and includes a new API.
10
+ See README for full documentation.
11
+
12
+ **Full Changelog**: https://github.com/OneSignal/onesignal-ruby-client/compare/v0.3.0...1.0.0.beta1
13
+
14
+ ## [0.3.0] - 2016-05-10
15
+ ### Added
16
+ * Models dynamically create attributes on initialization
17
+
18
+ ## [0.2.0] - 2016-04-29
19
+ ### Added
20
+ * Ruby 2.0 compatibility
21
+ * CHANGELOG
22
+
23
+ ### Fixed
24
+ * Typos in README
25
+
26
+ ## 0.1.0 - 2016-03-29
27
+ ### Added
28
+ * Methods for all OneSignal resources
29
+
30
+ [0.3.0]: https://github.com/coding-chimp/onesignal/compare/v0.2.0...v0.3.0
31
+ [0.2.0]: https://github.com/coding-chimp/onesignal/compare/v0.1.0...v0.2.0
data/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ Modified MIT License
2
+
3
+ Copyright 2022 OneSignal
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
+ 1. The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ 2. All copies of substantial portions of the Software may only be used in connection
16
+ with services provided by OneSignal.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,4 +1,19 @@
1
- # onesignal
1
+ <h1 align="center">Welcome to the official OneSignal Ruby Client 👋</h1>
2
+
3
+ [![Gem Version][rgb]][rgl]
4
+
5
+ <p>
6
+ <a href="https://github.com/OneSignal/onesignal-ruby-client/blob/master/README.md" target="_blank">
7
+ <img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
8
+ </a>
9
+ <a href="https://github.com/OneSignal/onesignal-ruby-client/graphs/commit-activity" target="_blank">
10
+ <img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" />
11
+ </a>
12
+ <a href="https://twitter.com/onesignal" target="_blank">
13
+ <img alt="Twitter: onesignal" src="https://img.shields.io/twitter/follow/onesignal.svg?style=social" />
14
+ </a>
15
+ </p>
16
+
2
17
 
3
18
  OneSignal - the Ruby gem for the OneSignal
4
19
 
@@ -6,75 +21,54 @@ A powerful way to send personalized messages at scale and build effective custom
6
21
 
7
22
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
23
 
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)
13
-
14
- ## Installation
15
-
16
- ### Build a gem
24
+ OneSignal is a simple ruby wrapper for the [OneSignal API][osa].
17
25
 
18
- To build the Ruby code into a gem:
26
+ ### 🖤 [RubyGems](https://rubygems.org/gems/onesignal)
19
27
 
20
- ```shell
21
- gem build onesignal.gemspec
22
- ```
28
+ ## Installation
23
29
 
24
- Then either install the gem locally:
30
+ Add this line to your application's Gemfile:
25
31
 
26
- ```shell
27
- gem install ./onesignal-1.0.0.gem
32
+ ```ruby
33
+ gem 'onesignal', '~> 1.0.1'
28
34
  ```
29
35
 
30
- (for development, run `gem install --dev ./onesignal-1.0.0.gem` to install the development dependencies)
31
-
32
- or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
36
+ And then execute:
33
37
 
34
- Finally add this to the Gemfile:
38
+ $ bundle
35
39
 
36
- gem 'onesignal', '~> 1.0.0'
40
+ Or install it yourself as:
37
41
 
38
- ### Install from Git
42
+ $ gem install onesignal
39
43
 
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:
44
+ Or install from Github:
41
45
 
42
- gem 'onesignal', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
43
-
44
- ### Include the Ruby code directly
45
-
46
- Include the Ruby code directly using `-I` as follows:
47
-
48
- ```shell
49
- ruby -Ilib script.rb
50
- ```
46
+ $ gem "onesignal", '~> 1.0.1', git: 'git://github.com/OneSignal/onesignal-ruby-api.git'
51
47
 
52
48
  ## Getting Started
53
49
 
54
50
  Please follow the [installation](#installation) procedure and then run the following code:
55
51
 
56
52
  ```ruby
57
- # Load the gem
53
+ require 'time'
58
54
  require 'onesignal'
59
-
60
- # Setup authorization
55
+ # setup authorization
61
56
  OneSignal.configure do |config|
62
57
  # Configure Bearer authorization: app_key
63
- config.access_token = 'YOUR_BEARER_TOKEN'
58
+ config.user_key = 'YOUR_USER_KEY' # Change this
59
+ config.app_key = 'YOUR_APP_KEY'
64
60
  end
65
61
 
66
62
  api_instance = OneSignal::DefaultApi.new
67
- app_id = 'app_id_example' # String |
68
- notification_id = 'notification_id_example' # String |
63
+ notification = OneSignal::Notification.new({app_id: 'YOUR APP ID'}) # Notification
69
64
 
70
65
  begin
71
- #Stop a scheduled or currently outgoing notification
72
- result = api_instance.cancel_notification(app_id, notification_id)
66
+ # Create notification
67
+ result = api_instance.create_notification(notification)
73
68
  p result
74
69
  rescue OneSignal::ApiError => e
75
- puts "Exception when calling DefaultApi->cancel_notification: #{e}"
70
+ puts "Error when calling DefaultApi->create_notification: #{e}"
76
71
  end
77
-
78
72
  ```
79
73
 
80
74
  ## Documentation for API Endpoints
@@ -103,7 +97,6 @@ Class | Method | HTTP request | Description
103
97
  *OneSignal::DefaultApi* | [**update_player**](docs/DefaultApi.md#update_player) | **PUT** /players/{player_id} | Edit device
104
98
  *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
99
 
106
-
107
100
  ## Documentation for Models
108
101
 
109
102
  - [OneSignal::App](docs/App.md)
@@ -142,15 +135,52 @@ Class | Method | HTTP request | Description
142
135
  - [OneSignal::StringMap](docs/StringMap.md)
143
136
  - [OneSignal::UpdatePlayerTagsRequestBody](docs/UpdatePlayerTagsRequestBody.md)
144
137
 
145
-
146
138
  ## Documentation for Authorization
147
139
 
148
-
149
140
  ### app_key
150
141
 
151
142
  - **Type**: Bearer authentication
152
143
 
144
+ ```rb
145
+ OneSignal.configure do |config|
146
+ config.app_key = 'APP_KEY' # replace with your app key
147
+ end
148
+ ```
149
+
153
150
  ### user_key
154
151
 
155
152
  - **Type**: Bearer authentication
156
153
 
154
+ ```rb
155
+ OneSignal.configure do |config|
156
+ config.user_key = 'USER_KEY' # replace with your user key
157
+ end
158
+ ```
159
+
160
+ ## License
161
+
162
+ The gem is available as open source under the terms of the [MIT License][mit].
163
+
164
+ [rgb]: https://img.shields.io/gem/v/onesignal.svg
165
+ [rgl]: https://rubygems.org/gems/onesignal
166
+ [osa]: https://documentation.onesignal.com/reference/
167
+ [mit]: http://opensource.org/licenses/MIT
168
+
169
+ ## Author
170
+
171
+ * Website: https://onesignal.com
172
+ * Twitter: [@onesignal](https://twitter.com/onesignal)
173
+ * Github: [@OneSignal](https://github.com/OneSignal)
174
+
175
+ ## 🤝 Contributing
176
+
177
+ Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/OneSignal/onesignal-ruby-client/issues).
178
+
179
+ ## Show your support
180
+
181
+ Give a ⭐️ if this project helped you!
182
+
183
+ ## 📝 License
184
+
185
+ Copyright © 2022 [OneSignal](https://github.com/OneSignal).<br />
186
+ This project is [MIT](https://opensource.org/licenses/MIT) licensed.
@@ -0,0 +1,11 @@
1
+ # Release Instructions
2
+ 1. Generate new client version using OpenApi Generator
3
+ 2. Make sure `ruby.yml` has the correct gem version
4
+ 2. Create a new PR and merge
5
+ * Carefully review the PR to ensure nothing is overwritten and you are including all desired changes
6
+ * Ensure the correct version number is being sent in the header params `OS-Usage-Data` (`api_client.rb`)
7
+ 3. Generate the gem: `gem build onesignal`
8
+ 4. Publish to RubyGems
9
+ * To publish version 0.1.0 of a new gem called 'squid-utils', run: `gem push squid-utils-0.1.0.gem`
10
+ * To publish a beta version, simply add `.beta1`, `.beta2` etc... after the semantic version (e.g: `1.0.0.beta1`)
11
+