onesignal 0.2.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +14 -0
- data/Gemfile +6 -1
- data/LICENSE +6 -3
- data/README.md +144 -99
- data/RELEASE_INSTRUCTIONS.md +11 -0
- 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/InlineResponse2005.md +20 -0
- data/docs/InlineResponse2007.md +18 -0
- data/docs/InlineResponse2008.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 +20 -0
- data/docs/InlineResponse4003.md +18 -0
- data/docs/InvalidIdentifierError.md +20 -0
- data/docs/Notification.md +240 -0
- data/docs/Notification200Errors.md +49 -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/NotificationWithMeta.md +260 -0
- data/docs/NotificationWithMetaAllOf.md +38 -0
- data/docs/Operator.md +18 -0
- data/docs/OutcomeData.md +22 -0
- data/docs/OutcomesData.md +18 -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/lib/onesignal/api/default_api.rb +1365 -0
- data/lib/onesignal/api_client.rb +393 -0
- data/lib/onesignal/api_error.rb +57 -0
- data/lib/onesignal/configuration.rb +245 -0
- data/lib/onesignal/models/app.rb +519 -20
- data/lib/onesignal/models/button.rb +242 -0
- data/lib/onesignal/models/delivery_data.rb +260 -0
- data/lib/onesignal/models/export_players_request_body.rb +242 -0
- data/lib/onesignal/models/filter.rb +294 -0
- data/lib/onesignal/models/filter_expressions.rb +336 -0
- data/lib/onesignal/models/filter_notification_target.rb +330 -0
- data/lib/onesignal/models/get_notification_request_body.rb +273 -0
- data/lib/onesignal/models/inline_response200.rb +257 -0
- data/lib/onesignal/models/inline_response2001.rb +219 -0
- data/lib/onesignal/models/inline_response2002.rb +228 -0
- data/lib/onesignal/models/inline_response2005.rb +228 -0
- data/lib/onesignal/models/inline_response2007.rb +219 -0
- data/lib/onesignal/models/inline_response2008.rb +219 -0
- data/lib/onesignal/models/inline_response201.rb +229 -0
- data/lib/onesignal/models/inline_response400.rb +221 -0
- data/lib/onesignal/models/inline_response4001.rb +230 -0
- data/lib/onesignal/models/inline_response4002.rb +230 -0
- data/lib/onesignal/models/inline_response4003.rb +221 -0
- data/lib/onesignal/models/invalid_identifier_error.rb +234 -0
- data/lib/onesignal/models/notification.rb +1414 -9
- data/lib/onesignal/models/notification200_errors.rb +105 -0
- data/lib/onesignal/models/notification_all_of.rb +1144 -0
- data/lib/onesignal/models/notification_all_of_android_background_layout.rb +241 -0
- data/lib/onesignal/models/notification_slice.rb +248 -0
- data/lib/onesignal/models/notification_target.rb +495 -0
- data/lib/onesignal/models/notification_with_meta.rb +1526 -0
- data/lib/onesignal/models/notification_with_meta_all_of.rb +322 -0
- data/lib/onesignal/models/operator.rb +254 -0
- data/lib/onesignal/models/outcome_data.rb +286 -0
- data/lib/onesignal/models/outcomes_data.rb +221 -0
- data/lib/onesignal/models/platform_delivery_data.rb +265 -0
- data/lib/onesignal/models/player.rb +480 -13
- data/lib/onesignal/models/player_notification_target.rb +330 -0
- data/lib/onesignal/models/player_slice.rb +248 -0
- data/lib/onesignal/models/purchase.rb +255 -0
- data/lib/onesignal/models/segment.rb +252 -0
- data/lib/onesignal/models/segment_notification_target.rb +234 -0
- data/lib/onesignal/models/string_map.rb +640 -0
- data/lib/onesignal/models/update_player_tags_request_body.rb +220 -0
- data/lib/onesignal/version.rb +13 -1
- data/lib/onesignal.rb +73 -16
- data/onesignal.gemspec +37 -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_response2005_spec.rb +40 -0
- data/spec/models/inline_response2007_spec.rb +34 -0
- data/spec/models/inline_response2008_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 +40 -0
- data/spec/models/inline_response4003_spec.rb +34 -0
- data/spec/models/inline_response400_spec.rb +34 -0
- data/spec/models/invalid_identifier_error_spec.rb +40 -0
- data/spec/models/notification200_errors_spec.rb +31 -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/notification_with_meta_all_of_spec.rb +94 -0
- data/spec/models/notification_with_meta_spec.rb +764 -0
- data/spec/models/operator_spec.rb +38 -0
- data/spec/models/outcome_data_spec.rb +50 -0
- data/spec/models/outcomes_data_spec.rb +34 -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 +203 -64
- data/.gitignore +0 -10
- data/.rubocop.yml +0 -17
- data/.travis.yml +0 -16
- data/CODE_OF_CONDUCT.md +0 -49
- 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 -19
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5ed573134bbb56b24a52664d42154e91205f9ea004d945816cece64b091f70a0
|
4
|
+
data.tar.gz: 9216667b6c7d0b68e7fd13556a27f88006bab0ed59747b3bf2e17a095c95afa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b57b8d0ed69672c664b0ec114576d702b0c601eef83e8c2db0a32d483a9bd79ecb5cfe27e442ede4785bd7fd18d039f4d3389487c20966ad22319f3198922dd5
|
7
|
+
data.tar.gz: d8f30f8aa642aab8150a908fc594d8c1c3e7e1f9da56999ed5b7f0c122682b741ab66c29f6beabe6c531b64c97c253ed062f9cf0c67794ee94e86cd6c7279972
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,19 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
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
|
+
|
5
18
|
## [0.2.0] - 2016-04-29
|
6
19
|
### Added
|
7
20
|
* Ruby 2.0 compatibility
|
@@ -14,4 +27,5 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
14
27
|
### Added
|
15
28
|
* Methods for all OneSignal resources
|
16
29
|
|
30
|
+
[0.3.0]: https://github.com/coding-chimp/onesignal/compare/v0.2.0...v0.3.0
|
17
31
|
[0.2.0]: https://github.com/coding-chimp/onesignal/compare/v0.1.0...v0.2.0
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
Modified MIT License
|
2
2
|
|
3
|
-
Copyright
|
3
|
+
Copyright 2022 OneSignal
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -9,9 +9,12 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
9
|
copies of the Software, and to permit persons to whom the Software is
|
10
10
|
furnished to do so, subject to the following conditions:
|
11
11
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
12
|
+
1. The above copyright notice and this permission notice shall be included in
|
13
13
|
all copies or substantial portions of the Software.
|
14
14
|
|
15
|
+
2. All copies of substantial portions of the Software may only be used in connection
|
16
|
+
with services provided by OneSignal.
|
17
|
+
|
15
18
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
19
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
20
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
data/README.md
CHANGED
@@ -1,15 +1,36 @@
|
|
1
|
-
|
1
|
+
<h1 align="center">Welcome to the official OneSignal Ruby Client 👋</h1>
|
2
2
|
|
3
|
-
[![Gem Version][rgb]][rgl]
|
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
|
+
|
17
|
+
|
18
|
+
OneSignal - the Ruby gem for the OneSignal
|
19
|
+
|
20
|
+
A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
|
21
|
+
|
22
|
+
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
4
23
|
|
5
24
|
OneSignal is a simple ruby wrapper for the [OneSignal API][osa].
|
6
25
|
|
26
|
+
### 🖤 [RubyGems](https://rubygems.org/gems/onesignal)
|
27
|
+
|
7
28
|
## Installation
|
8
29
|
|
9
30
|
Add this line to your application's Gemfile:
|
10
31
|
|
11
32
|
```ruby
|
12
|
-
gem 'onesignal'
|
33
|
+
gem 'onesignal', '~> 1.0.1'
|
13
34
|
```
|
14
35
|
|
15
36
|
And then execute:
|
@@ -20,122 +41,146 @@ Or install it yourself as:
|
|
20
41
|
|
21
42
|
$ gem install onesignal
|
22
43
|
|
23
|
-
|
24
|
-
|
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.
|
27
|
-
|
28
|
-
```ruby
|
29
|
-
client = OneSignal::Client.new(auth_token: 'AUTH_TOKEN', app_id: 'APP_ID')
|
30
|
-
```
|
31
|
-
|
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:
|
36
|
-
|
37
|
-
```ruby
|
38
|
-
client = OneSignal::Client.new(auth_token: 'AUTH_TOKEN')
|
39
|
-
client.apps #=> AppResource
|
40
|
-
```
|
44
|
+
Or install from Github:
|
41
45
|
|
42
|
-
|
43
|
-
example:
|
46
|
+
$ gem "onesignal", '~> 1.0.1', git: 'git://github.com/OneSignal/onesignal-ruby-api.git'
|
44
47
|
|
45
|
-
|
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
|
-
```
|
48
|
+
## Getting Started
|
50
49
|
|
51
|
-
|
52
|
-
the API supports it):
|
50
|
+
Please follow the [installation](#installation) procedure and then run the following code:
|
53
51
|
|
54
52
|
```ruby
|
55
|
-
|
56
|
-
|
57
|
-
#
|
53
|
+
require 'time'
|
54
|
+
require 'onesignal'
|
55
|
+
# setup authorization
|
56
|
+
OneSignal.configure do |config|
|
57
|
+
# Configure Bearer authorization: app_key
|
58
|
+
config.user_key = 'YOUR_USER_KEY' # Change this
|
59
|
+
config.app_key = 'YOUR_APP_KEY'
|
60
|
+
end
|
61
|
+
|
62
|
+
api_instance = OneSignal::DefaultApi.new
|
63
|
+
notification = OneSignal::Notification.new({app_id: 'YOUR APP ID'}) # Notification
|
64
|
+
|
65
|
+
begin
|
66
|
+
# Create notification
|
67
|
+
result = api_instance.create_notification(notification)
|
68
|
+
p result
|
69
|
+
rescue OneSignal::ApiError => e
|
70
|
+
puts "Error when calling DefaultApi->create_notification: #{e}"
|
71
|
+
end
|
58
72
|
```
|
59
73
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
74
|
+
## Documentation for API Endpoints
|
75
|
+
|
76
|
+
All URIs are relative to *https://onesignal.com/api/v1*
|
77
|
+
|
78
|
+
Class | Method | HTTP request | Description
|
79
|
+
------------ | ------------- | ------------- | -------------
|
80
|
+
*OneSignal::DefaultApi* | [**cancel_notification**](docs/DefaultApi.md#cancel_notification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification
|
81
|
+
*OneSignal::DefaultApi* | [**create_app**](docs/DefaultApi.md#create_app) | **POST** /apps | Create an app
|
82
|
+
*OneSignal::DefaultApi* | [**create_notification**](docs/DefaultApi.md#create_notification) | **POST** /notifications | Create notification
|
83
|
+
*OneSignal::DefaultApi* | [**create_player**](docs/DefaultApi.md#create_player) | **POST** /players | Add a device
|
84
|
+
*OneSignal::DefaultApi* | [**create_segments**](docs/DefaultApi.md#create_segments) | **POST** /apps/{app_id}/segments | Create Segments
|
85
|
+
*OneSignal::DefaultApi* | [**delete_player**](docs/DefaultApi.md#delete_player) | **DELETE** /players/{player_id} | Delete a user record
|
86
|
+
*OneSignal::DefaultApi* | [**delete_segments**](docs/DefaultApi.md#delete_segments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments
|
87
|
+
*OneSignal::DefaultApi* | [**export_players**](docs/DefaultApi.md#export_players) | **POST** /players/csv_export?app_id={app_id} | CSV export
|
88
|
+
*OneSignal::DefaultApi* | [**get_app**](docs/DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app
|
89
|
+
*OneSignal::DefaultApi* | [**get_apps**](docs/DefaultApi.md#get_apps) | **GET** /apps | View apps
|
90
|
+
*OneSignal::DefaultApi* | [**get_notification**](docs/DefaultApi.md#get_notification) | **GET** /notifications/{notification_id} | View notification
|
91
|
+
*OneSignal::DefaultApi* | [**get_notification_history**](docs/DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History
|
92
|
+
*OneSignal::DefaultApi* | [**get_notifications**](docs/DefaultApi.md#get_notifications) | **GET** /notifications | View notifications
|
93
|
+
*OneSignal::DefaultApi* | [**get_outcomes**](docs/DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes
|
94
|
+
*OneSignal::DefaultApi* | [**get_player**](docs/DefaultApi.md#get_player) | **GET** /players/{player_id} | View device
|
95
|
+
*OneSignal::DefaultApi* | [**get_players**](docs/DefaultApi.md#get_players) | **GET** /players | View devices
|
96
|
+
*OneSignal::DefaultApi* | [**update_app**](docs/DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app
|
97
|
+
*OneSignal::DefaultApi* | [**update_player**](docs/DefaultApi.md#update_player) | **PUT** /players/{player_id} | Edit device
|
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
|
99
|
+
|
100
|
+
## Documentation for Models
|
101
|
+
|
102
|
+
- [OneSignal::App](docs/App.md)
|
103
|
+
- [OneSignal::Button](docs/Button.md)
|
104
|
+
- [OneSignal::DeliveryData](docs/DeliveryData.md)
|
105
|
+
- [OneSignal::ExportPlayersRequestBody](docs/ExportPlayersRequestBody.md)
|
106
|
+
- [OneSignal::Filter](docs/Filter.md)
|
107
|
+
- [OneSignal::FilterExpressions](docs/FilterExpressions.md)
|
108
|
+
- [OneSignal::FilterNotificationTarget](docs/FilterNotificationTarget.md)
|
109
|
+
- [OneSignal::GetNotificationRequestBody](docs/GetNotificationRequestBody.md)
|
110
|
+
- [OneSignal::InlineResponse200](docs/InlineResponse200.md)
|
111
|
+
- [OneSignal::InlineResponse2001](docs/InlineResponse2001.md)
|
112
|
+
- [OneSignal::InlineResponse2002](docs/InlineResponse2002.md)
|
113
|
+
- [OneSignal::InlineResponse2003](docs/InlineResponse2003.md)
|
114
|
+
- [OneSignal::InlineResponse2004](docs/InlineResponse2004.md)
|
115
|
+
- [OneSignal::InlineResponse2005](docs/InlineResponse2005.md)
|
116
|
+
- [OneSignal::InlineResponse201](docs/InlineResponse201.md)
|
117
|
+
- [OneSignal::InlineResponse400](docs/InlineResponse400.md)
|
118
|
+
- [OneSignal::InlineResponse4001](docs/InlineResponse4001.md)
|
119
|
+
- [OneSignal::InlineResponse4002](docs/InlineResponse4002.md)
|
120
|
+
- [OneSignal::InlineResponse409](docs/InlineResponse409.md)
|
121
|
+
- [OneSignal::Notification](docs/Notification.md)
|
122
|
+
- [OneSignal::NotificationAllOf](docs/NotificationAllOf.md)
|
123
|
+
- [OneSignal::NotificationAllOfAndroidBackgroundLayout](docs/NotificationAllOfAndroidBackgroundLayout.md)
|
124
|
+
- [OneSignal::NotificationSlice](docs/NotificationSlice.md)
|
125
|
+
- [OneSignal::NotificationTarget](docs/NotificationTarget.md)
|
126
|
+
- [OneSignal::Operator](docs/Operator.md)
|
127
|
+
- [OneSignal::OutcomeData](docs/OutcomeData.md)
|
128
|
+
- [OneSignal::PlatformDeliveryData](docs/PlatformDeliveryData.md)
|
129
|
+
- [OneSignal::Player](docs/Player.md)
|
130
|
+
- [OneSignal::PlayerNotificationTarget](docs/PlayerNotificationTarget.md)
|
131
|
+
- [OneSignal::PlayerSlice](docs/PlayerSlice.md)
|
132
|
+
- [OneSignal::Purchase](docs/Purchase.md)
|
133
|
+
- [OneSignal::Segment](docs/Segment.md)
|
134
|
+
- [OneSignal::SegmentNotificationTarget](docs/SegmentNotificationTarget.md)
|
135
|
+
- [OneSignal::StringMap](docs/StringMap.md)
|
136
|
+
- [OneSignal::UpdatePlayerTagsRequestBody](docs/UpdatePlayerTagsRequestBody.md)
|
137
|
+
|
138
|
+
## Documentation for Authorization
|
139
|
+
|
140
|
+
### app_key
|
141
|
+
|
142
|
+
- **Type**: Bearer authentication
|
143
|
+
|
144
|
+
```rb
|
145
|
+
OneSignal.configure do |config|
|
146
|
+
config.app_key = 'APP_KEY' # replace with your app key
|
147
|
+
end
|
68
148
|
```
|
69
149
|
|
70
|
-
###
|
150
|
+
### user_key
|
71
151
|
|
72
|
-
|
152
|
+
- **Type**: Bearer authentication
|
73
153
|
|
74
|
-
```
|
75
|
-
|
76
|
-
|
154
|
+
```rb
|
155
|
+
OneSignal.configure do |config|
|
156
|
+
config.user_key = 'USER_KEY' # replace with your user key
|
157
|
+
end
|
77
158
|
```
|
78
159
|
|
79
|
-
|
80
|
-
|
81
|
-
* `client.apps.all`
|
82
|
-
* `client.apps.find(id)`
|
83
|
-
* `client.apps.create(params)`
|
84
|
-
* `client.apps.update(id, params)`
|
85
|
-
|
86
|
-
#### Player resource
|
87
|
-
|
88
|
-
```ruby
|
89
|
-
client = OneSignal::Client.new(auth_token: 'AUTH_TOKEN', app_id: 'APP_ID')
|
90
|
-
client.players #=> OneSignal::PlayerResource
|
91
|
-
```
|
92
|
-
|
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)`
|
160
|
+
## License
|
104
161
|
|
105
|
-
|
162
|
+
The gem is available as open source under the terms of the [MIT License][mit].
|
106
163
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
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
|
111
168
|
|
112
|
-
|
169
|
+
## Author
|
113
170
|
|
114
|
-
*
|
115
|
-
*
|
116
|
-
*
|
117
|
-
* `client.notifications.track_open(id, params)`
|
118
|
-
* `client.notifications.create(params)`
|
119
|
-
* `client.notifications.cancel(id)`
|
171
|
+
* Website: https://onesignal.com
|
172
|
+
* Twitter: [@onesignal](https://twitter.com/onesignal)
|
173
|
+
* Github: [@OneSignal](https://github.com/OneSignal)
|
120
174
|
|
121
|
-
## Contributing
|
175
|
+
## 🤝 Contributing
|
122
176
|
|
123
|
-
|
177
|
+
Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/OneSignal/onesignal-ruby-client/issues).
|
124
178
|
|
125
|
-
|
126
|
-
contributors are expected to adhere to the [Contributor Covenant][cc] code of conduct.
|
179
|
+
## Show your support
|
127
180
|
|
128
|
-
|
181
|
+
Give a ⭐️ if this project helped you!
|
129
182
|
|
130
|
-
|
183
|
+
## 📝 License
|
131
184
|
|
132
|
-
[
|
133
|
-
[
|
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
|
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
|
+
|
data/Rakefile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
require
|
2
|
-
require 'rake/testtask'
|
1
|
+
require "bundler/gem_tasks"
|
3
2
|
|
4
|
-
|
5
|
-
|
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
|
-
|
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'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
|
+
|