Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ OneSignal - the Ruby gem for OneSignal

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

- API version: 5.7.0
- Package version: 5.7.0
- API version: 5.8.0
- Package version: 5.8.0

## Installation

Add to your `Gemfile`:

```ruby
gem 'onesignal', '~> 5.7.0'
gem 'onesignal', '~> 5.8.0'
```

Then run `bundle install`.
Expand Down
2 changes: 1 addition & 1 deletion docs/CreateNotificationSuccessResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | Notification identifier when the request created a notification. An empty string means no notification was created; read `errors` for details (HTTP may still be 200). | [optional] |
| **id** | **String** | Notification identifier when the request created a notification. An empty string means no notification was created; read `errors` for details (HTTP may still be 200). All OneSignal server SDKs expose message-sent / message-not-sent narrowing helpers (named idiomatically per language — e.g. `isMessageSent`, `is_message_sent`, `message_sent?`); prefer them over comparing `id` directly. | [optional] |
| **external_id** | **String** | Optional correlation / idempotency-related value from the API response. This is not the end-user External ID used for targeting recipients (that lives under `include_aliases.external_id`). | [optional] |
| **errors** | **Object** | Polymorphic field: may be an array of human-readable strings and/or an object (for example with `invalid_aliases`, `invalid_external_user_ids`, or `invalid_player_ids`) depending on the API response; HTTP may still be 200 with partial success. Typed SDKs model this loosely so both shapes deserialize. | [optional] |

Expand Down
4 changes: 3 additions & 1 deletion docs/DefaultApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -2214,7 +2214,8 @@ app_id = '00000000-0000-0000-0000-000000000000' # String | The app ID that you w
opts = {
limit: 10, # Integer | How many notifications to return. Max is 50. Default is 50.
offset: 0, # Integer | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at.
kind: 0 # Integer | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only
kind: 0, # Integer | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only
time_offset: '2025-01-01T00:00:00.000Z' # String | Time-offset pagination cursor for sequential pulls of all messages. Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response. When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used. Repeat the request with each `next_time_offset` until an empty notifications array is returned.
}

begin
Expand Down Expand Up @@ -2259,6 +2260,7 @@ end
| **limit** | **Integer** | How many notifications to return. Max is 50. Default is 50. | [optional] |
| **offset** | **Integer** | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. | [optional] |
| **kind** | **Integer** | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only | [optional] |
| **time_offset** | **String** | Time-offset pagination cursor for sequential pulls of all messages. Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response. When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used. Repeat the request with each `next_time_offset` until an empty notifications array is returned. | [optional] |

### Return type

Expand Down
4 changes: 4 additions & 0 deletions docs/NotificationSlice.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
| **total_count** | **Integer** | | [optional] |
| **offset** | **Integer** | | [optional] |
| **limit** | **Integer** | | [optional] |
| **time_offset** | **String** | The time_offset cursor specified in the request, if any. | [optional] |
| **next_time_offset** | **String** | An opaque Base64 cursor token representing the next page of messages to fetch. Present when time_offset was provided in the request. Pass this value as time_offset on the next request to continue paginating. | [optional] |
| **notifications** | [**Array<NotificationWithMeta>**](NotificationWithMeta.md) | | [optional] |

## Example
Expand All @@ -18,6 +20,8 @@ instance = OneSignal::NotificationSlice.new(
total_count: null,
offset: null,
limit: null,
time_offset: null,
next_time_offset: null,
notifications: null
)
```
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
5 changes: 4 additions & 1 deletion lib/onesignal/api/default_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down Expand Up @@ -1888,6 +1888,7 @@ def get_notification_history_with_http_info(notification_id, get_notification_hi
# @option opts [Integer] :limit How many notifications to return. Max is 50. Default is 50.
# @option opts [Integer] :offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at.
# @option opts [Integer] :kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only
# @option opts [String] :time_offset Time-offset pagination cursor for sequential pulls of all messages. Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response. When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used. Repeat the request with each `next_time_offset` until an empty notifications array is returned.
# @return [NotificationSlice]
def get_notifications(app_id, opts = {})
data, _status_code, _headers = get_notifications_with_http_info(app_id, opts)
Expand All @@ -1901,6 +1902,7 @@ def get_notifications(app_id, opts = {})
# @option opts [Integer] :limit How many notifications to return. Max is 50. Default is 50.
# @option opts [Integer] :offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at.
# @option opts [Integer] :kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only
# @option opts [String] :time_offset Time-offset pagination cursor for sequential pulls of all messages. Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response. When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used. Repeat the request with each `next_time_offset` until an empty notifications array is returned.
# @return [Array<(NotificationSlice, Integer, Hash)>] NotificationSlice data, response status code and response headers
def get_notifications_with_http_info(app_id, opts = {})
if @api_client.config.debugging
Expand All @@ -1923,6 +1925,7 @@ def get_notifications_with_http_info(app_id, opts = {})
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
query_params[:'kind'] = opts[:'kind'] if !opts[:'kind'].nil?
query_params[:'time_offset'] = opts[:'time_offset'] if !opts[:'time_offset'].nil?

# header parameters
header_params = opts[:header_params] || {}
Expand Down
4 changes: 2 additions & 2 deletions lib/onesignal/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down Expand Up @@ -90,7 +90,7 @@ def build_request(http_method, path, opts = {})
url = build_request_url(path, opts)
http_method = http_method.to_sym.downcase

opts[:header_params]['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-ruby, version=5.7.0'
opts[:header_params]['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-ruby, version=5.8.0'
header_params = @default_headers.merge(opts[:header_params] || {})
query_params = opts[:query_params] || {}
form_params = opts[:form_params] || {}
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/api_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
24 changes: 24 additions & 0 deletions lib/onesignal/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,30 @@ def self.create_notification_with_retry(api, notification, max_retries: 3, base_
end
end

# Whether a POST /notifications 200 response is the "message sent" branch.
#
# POST /notifications returns 200 in two cases that share the
# CreateNotificationSuccessResponse shape: a notification was created
# (non-empty +id+), or none was (empty +id+, with +errors+ carrying the
# reason). Prefer this guard over inspecting +id+ directly.
#
# @param response [CreateNotificationSuccessResponse]
# @return [Boolean] true when a notification was created
def self.message_sent?(response)
id = response.respond_to?(:id) ? response.id : nil
id.is_a?(String) && !id.empty?
end

# Whether a POST /notifications 200 response is the "message not sent"
# branch -- no notification was created (+id+ absent or empty); inspect
# +errors+ for why.
#
# @param response [CreateNotificationSuccessResponse]
# @return [Boolean] true when no notification was created
def self.message_not_sent?(response)
!message_sent?(response)
end

def self.header_value(headers, name)
return nil unless headers.respond_to?(:each_pair)

Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/api_key_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/api_key_tokens_list_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/basic_notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/basic_notification_all_of.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/button.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/copy_template_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/create_api_key_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/create_api_key_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
4 changes: 2 additions & 2 deletions lib/onesignal/models/create_notification_success_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand All @@ -15,7 +15,7 @@

module OneSignal
class CreateNotificationSuccessResponse
# Notification identifier when the request created a notification. An empty string means no notification was created; read `errors` for details (HTTP may still be 200).
# Notification identifier when the request created a notification. An empty string means no notification was created; read `errors` for details (HTTP may still be 200). All OneSignal server SDKs expose message-sent / message-not-sent narrowing helpers (named idiomatically per language — e.g. `isMessageSent`, `is_message_sent`, `message_sent?`); prefer them over comparing `id` directly.
attr_accessor :id

# Optional correlation / idempotency-related value from the API response. This is not the end-user External ID used for targeting recipients (that lives under `include_aliases.external_id`).
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/create_segment_conflict_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/create_segment_success_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/create_template_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/create_user_conflict_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/custom_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/custom_events_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/delivery_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
2 changes: 1 addition & 1 deletion lib/onesignal/models/export_events_success_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

The version of the OpenAPI document: 5.7.0
The version of the OpenAPI document: 5.8.0
Contact: devrel@onesignal.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
Expand Down
Loading