Skip to content

Commit a4f2a20

Browse files
author
OneSignal
committed
Update Ruby API
1 parent 0e53f85 commit a4f2a20

116 files changed

Lines changed: 2006 additions & 198 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 76 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,80 @@
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-
1+
# onesignal
172

183
OneSignal - the Ruby gem for the OneSignal
194

205
A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
216

227
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
238

24-
OneSignal is a simple ruby wrapper for the [OneSignal API][osa].
25-
26-
### 🖤 [RubyGems](https://rubygems.org/gems/onesignal)
9+
- API version: 1.0.2
10+
- Package version: 1.0.2
11+
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
12+
For more information, please visit [https://onesignal.com](https://onesignal.com)
2713

2814
## Installation
2915

30-
Add this line to your application's Gemfile:
16+
### Build a gem
3117

32-
```ruby
33-
gem 'onesignal', '~> 1.0.1'
18+
To build the Ruby code into a gem:
19+
20+
```shell
21+
gem build onesignal.gemspec
3422
```
3523

36-
And then execute:
24+
Then either install the gem locally:
25+
26+
```shell
27+
gem install ./onesignal-1.0.2.gem
28+
```
29+
30+
(for development, run `gem install --dev ./onesignal-1.0.2.gem` to install the development dependencies)
31+
32+
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
3733

38-
$ bundle
34+
Finally add this to the Gemfile:
3935

40-
Or install it yourself as:
36+
gem 'onesignal', '~> 1.0.2'
4137

42-
$ gem install onesignal
38+
### Install from Git
4339

44-
Or install from Github:
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:
4541

46-
$ gem "onesignal", '~> 1.0.1', git: 'git://github.com/OneSignal/onesignal-ruby-api.git'
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+
```
4751

4852
## Getting Started
4953

5054
Please follow the [installation](#installation) procedure and then run the following code:
5155

5256
```ruby
53-
require 'time'
57+
# Load the gem
5458
require 'onesignal'
55-
# setup authorization
59+
60+
# Setup authorization
5661
OneSignal.configure do |config|
5762
# Configure Bearer authorization: app_key
58-
config.user_key = 'YOUR_USER_KEY' # Change this
59-
config.app_key = 'YOUR_APP_KEY'
63+
config.access_token = 'YOUR_BEARER_TOKEN'
6064
end
6165

6266
api_instance = OneSignal::DefaultApi.new
63-
notification = OneSignal::Notification.new({app_id: 'YOUR APP ID'}) # Notification
67+
app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
68+
activity_id = 'activity_id_example' # String | Live Activity record ID
69+
begin_live_activity_request = OneSignal::BeginLiveActivityRequest.new({push_token: 'push_token_example', subscription_id: 'subscription_id_example'}) # BeginLiveActivityRequest |
6470

6571
begin
66-
# Create notification
67-
result = api_instance.create_notification(notification)
68-
p result
72+
#Start Live Activity
73+
api_instance.begin_live_activity(app_id, activity_id, begin_live_activity_request)
6974
rescue OneSignal::ApiError => e
70-
puts "Error when calling DefaultApi->create_notification: #{e}"
75+
puts "Exception when calling DefaultApi->begin_live_activity: #{e}"
7176
end
77+
7278
```
7379

7480
## Documentation for API Endpoints
@@ -77,13 +83,15 @@ All URIs are relative to *https://onesignal.com/api/v1*
7783

7884
Class | Method | HTTP request | Description
7985
------------ | ------------- | ------------- | -------------
86+
*OneSignal::DefaultApi* | [**begin_live_activity**](docs/DefaultApi.md#begin_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/token | Start Live Activity
8087
*OneSignal::DefaultApi* | [**cancel_notification**](docs/DefaultApi.md#cancel_notification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification
8188
*OneSignal::DefaultApi* | [**create_app**](docs/DefaultApi.md#create_app) | **POST** /apps | Create an app
8289
*OneSignal::DefaultApi* | [**create_notification**](docs/DefaultApi.md#create_notification) | **POST** /notifications | Create notification
8390
*OneSignal::DefaultApi* | [**create_player**](docs/DefaultApi.md#create_player) | **POST** /players | Add a device
8491
*OneSignal::DefaultApi* | [**create_segments**](docs/DefaultApi.md#create_segments) | **POST** /apps/{app_id}/segments | Create Segments
8592
*OneSignal::DefaultApi* | [**delete_player**](docs/DefaultApi.md#delete_player) | **DELETE** /players/{player_id} | Delete a user record
8693
*OneSignal::DefaultApi* | [**delete_segments**](docs/DefaultApi.md#delete_segments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments
94+
*OneSignal::DefaultApi* | [**end_live_activity**](docs/DefaultApi.md#end_live_activity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity
8795
*OneSignal::DefaultApi* | [**export_players**](docs/DefaultApi.md#export_players) | **POST** /players/csv_export?app_id&#x3D;{app_id} | CSV export
8896
*OneSignal::DefaultApi* | [**get_app**](docs/DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app
8997
*OneSignal::DefaultApi* | [**get_apps**](docs/DefaultApi.md#get_apps) | **GET** /apps | View apps
@@ -94,93 +102,72 @@ Class | Method | HTTP request | Description
94102
*OneSignal::DefaultApi* | [**get_player**](docs/DefaultApi.md#get_player) | **GET** /players/{player_id} | View device
95103
*OneSignal::DefaultApi* | [**get_players**](docs/DefaultApi.md#get_players) | **GET** /players | View devices
96104
*OneSignal::DefaultApi* | [**update_app**](docs/DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app
105+
*OneSignal::DefaultApi* | [**update_live_activity**](docs/DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push
97106
*OneSignal::DefaultApi* | [**update_player**](docs/DefaultApi.md#update_player) | **PUT** /players/{player_id} | Edit device
98107
*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
99108

109+
100110
## Documentation for Models
101111

102112
- [OneSignal::App](docs/App.md)
113+
- [OneSignal::BadRequestError](docs/BadRequestError.md)
114+
- [OneSignal::BasicNotification](docs/BasicNotification.md)
115+
- [OneSignal::BasicNotificationAllOf](docs/BasicNotificationAllOf.md)
116+
- [OneSignal::BasicNotificationAllOfAndroidBackgroundLayout](docs/BasicNotificationAllOfAndroidBackgroundLayout.md)
117+
- [OneSignal::BeginLiveActivityRequest](docs/BeginLiveActivityRequest.md)
103118
- [OneSignal::Button](docs/Button.md)
119+
- [OneSignal::CancelNotificationSuccessResponse](docs/CancelNotificationSuccessResponse.md)
120+
- [OneSignal::CreateNotificationSuccessResponse](docs/CreateNotificationSuccessResponse.md)
121+
- [OneSignal::CreatePlayerSuccessResponse](docs/CreatePlayerSuccessResponse.md)
122+
- [OneSignal::CreateSegmentConflictResponse](docs/CreateSegmentConflictResponse.md)
123+
- [OneSignal::CreateSegmentSuccessResponse](docs/CreateSegmentSuccessResponse.md)
124+
- [OneSignal::DeletePlayerNotFoundResponse](docs/DeletePlayerNotFoundResponse.md)
125+
- [OneSignal::DeletePlayerSuccessResponse](docs/DeletePlayerSuccessResponse.md)
126+
- [OneSignal::DeleteSegmentNotFoundResponse](docs/DeleteSegmentNotFoundResponse.md)
127+
- [OneSignal::DeleteSegmentSuccessResponse](docs/DeleteSegmentSuccessResponse.md)
104128
- [OneSignal::DeliveryData](docs/DeliveryData.md)
105129
- [OneSignal::ExportPlayersRequestBody](docs/ExportPlayersRequestBody.md)
130+
- [OneSignal::ExportPlayersSuccessResponse](docs/ExportPlayersSuccessResponse.md)
106131
- [OneSignal::Filter](docs/Filter.md)
107132
- [OneSignal::FilterExpressions](docs/FilterExpressions.md)
108-
- [OneSignal::FilterNotificationTarget](docs/FilterNotificationTarget.md)
109133
- [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)
134+
- [OneSignal::InvalidIdentifierError](docs/InvalidIdentifierError.md)
121135
- [OneSignal::Notification](docs/Notification.md)
136+
- [OneSignal::Notification200Errors](docs/Notification200Errors.md)
122137
- [OneSignal::NotificationAllOf](docs/NotificationAllOf.md)
123-
- [OneSignal::NotificationAllOfAndroidBackgroundLayout](docs/NotificationAllOfAndroidBackgroundLayout.md)
138+
- [OneSignal::NotificationHistorySuccessResponse](docs/NotificationHistorySuccessResponse.md)
124139
- [OneSignal::NotificationSlice](docs/NotificationSlice.md)
125140
- [OneSignal::NotificationTarget](docs/NotificationTarget.md)
141+
- [OneSignal::NotificationWithMeta](docs/NotificationWithMeta.md)
142+
- [OneSignal::NotificationWithMetaAllOf](docs/NotificationWithMetaAllOf.md)
126143
- [OneSignal::Operator](docs/Operator.md)
127144
- [OneSignal::OutcomeData](docs/OutcomeData.md)
145+
- [OneSignal::OutcomesData](docs/OutcomesData.md)
128146
- [OneSignal::PlatformDeliveryData](docs/PlatformDeliveryData.md)
147+
- [OneSignal::PlatformDeliveryDataEmailAllOf](docs/PlatformDeliveryDataEmailAllOf.md)
148+
- [OneSignal::PlatformDeliveryDataSmsAllOf](docs/PlatformDeliveryDataSmsAllOf.md)
129149
- [OneSignal::Player](docs/Player.md)
130150
- [OneSignal::PlayerNotificationTarget](docs/PlayerNotificationTarget.md)
131151
- [OneSignal::PlayerSlice](docs/PlayerSlice.md)
132152
- [OneSignal::Purchase](docs/Purchase.md)
133153
- [OneSignal::Segment](docs/Segment.md)
134154
- [OneSignal::SegmentNotificationTarget](docs/SegmentNotificationTarget.md)
135155
- [OneSignal::StringMap](docs/StringMap.md)
156+
- [OneSignal::UpdateLiveActivityRequest](docs/UpdateLiveActivityRequest.md)
157+
- [OneSignal::UpdateLiveActivitySuccessResponse](docs/UpdateLiveActivitySuccessResponse.md)
158+
- [OneSignal::UpdatePlayerSuccessResponse](docs/UpdatePlayerSuccessResponse.md)
136159
- [OneSignal::UpdatePlayerTagsRequestBody](docs/UpdatePlayerTagsRequestBody.md)
160+
- [OneSignal::UpdatePlayerTagsSuccessResponse](docs/UpdatePlayerTagsSuccessResponse.md)
161+
137162

138163
## Documentation for Authorization
139164

165+
140166
### app_key
141167

142168
- **Type**: Bearer authentication
143169

144-
```rb
145-
OneSignal.configure do |config|
146-
config.app_key = 'APP_KEY' # replace with your app key
147-
end
148-
```
149-
150170
### user_key
151171

152172
- **Type**: Bearer authentication
153173

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.

docs/App.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
| **safari_apns_certificates** | **String** | | [optional][readonly] |
2424
| **safari_apns_p12** | **String** | Safari: Your apple push notification p12 certificate file for Safari Push Notifications, converted to a string and Base64 encoded. | [optional] |
2525
| **safari_apns_p12_password** | **String** | Safari: Password for safari_apns_p12 file | [optional] |
26+
| **apns_key_id** | **String** | iOS: Required if using p8. Unique identifier for the p8 authentication key. | [optional] |
27+
| **apns_team_id** | **String** | iOS: Required if using p8. Team ID generated by Apple for your developer account. | [optional] |
28+
| **apns_bundle_id** | **String** | iOS: Required if using p8. Bundle ID for your app in the Apple ecosystem. | [optional] |
29+
| **apns_p8** | **String** | iOS: Required if using p8. Base64 encoded p8 key | [optional] |
2630
| **safari_site_origin** | **String** | Safari (Recommended): The hostname to your website including http(s):// | [optional] |
2731
| **safari_push_id** | **String** | | [optional][readonly] |
2832
| **safari_icon_16_16** | **String** | | [optional][readonly] |
@@ -60,6 +64,10 @@ instance = OneSignal::App.new(
6064
safari_apns_certificates: null,
6165
safari_apns_p12: null,
6266
safari_apns_p12_password: null,
67+
apns_key_id: null,
68+
apns_team_id: null,
69+
apns_bundle_id: null,
70+
apns_p8: null,
6371
safari_site_origin: null,
6472
safari_push_id: null,
6573
safari_icon_16_16: null,

docs/BadRequestError.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# OneSignal::BadRequestError
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
| **errors** | **Array&lt;String&gt;** | | [optional] |
8+
9+
## Example
10+
11+
```ruby
12+
require 'onesignal'
13+
14+
instance = OneSignal::BadRequestError.new(
15+
errors: null
16+
)
17+
```
18+

docs/BeginLiveActivityRequest.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# OneSignal::BeginLiveActivityRequest
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
| **push_token** | **String** | | |
8+
| **subscription_id** | **String** | | |
9+
10+
## Example
11+
12+
```ruby
13+
require 'onesignal'
14+
15+
instance = OneSignal::BeginLiveActivityRequest.new(
16+
push_token: null,
17+
subscription_id: null
18+
)
19+
```
20+

0 commit comments

Comments
 (0)