diff --git a/.github/ISSUE_TEMPLATE/ask-question.yml b/.github/ISSUE_TEMPLATE/ask-question.yml new file mode 100644 index 0000000..3da173f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/ask-question.yml @@ -0,0 +1,25 @@ +name: 🙋‍♂️ Ask a question +description: Tell us what's on your mind +title: "[question]: " +labels: ["triage"] +body: + - type: markdown + attributes: + value: | + Having issues integrating this API library? + - type: textarea + id: question + attributes: + label: How can we help? + description: Specific question regarding integrating this API library. + placeholder: How do I...? + validations: + required: true + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/api/blob/main/CONTRIBUTING.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000..f274813 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,51 @@ +name: 🪳 Bug report +description: File a bug report +title: "[Bug]: " +labels: ["bug", "triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Provide a thorough description of whats going on. + placeholder: The latest version of the API library throws an exception when creating a notification targetting all Active Users. + validations: + required: true + - type: textarea + id: reproduction-steps + attributes: + label: Steps to reproduce? + description: Provide as much detail as posible to reproduce the issue. + placeholder: | + 1. Install vX.Y.Z of dependency + 2. Run provided code snippet + 3. Note that the app crashes + render: Markdown + validations: + required: true + - type: textarea + id: what-are-expectations + attributes: + label: What did you expect to happen? + description: Also tell us, what did you expect to happen? + placeholder: I expected the API library to properly deserialize any response returned by OneSignal. + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: Shell + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/api/blob/main/CONTRIBUTING.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/general-feedback.yml b/.github/ISSUE_TEMPLATE/general-feedback.yml new file mode 100644 index 0000000..e632759 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/general-feedback.yml @@ -0,0 +1,25 @@ +name: 📣 General feedback +description: Tell us what's on your mind +title: "[Bug]: " +labels: ["triage"] +body: + - type: markdown + attributes: + value: | + Thanks for sharing your valuable feedback! + - type: textarea + id: feedback + attributes: + label: What's on your mind? + description: Feedback regarding this API library. + placeholder: Share your feedback... + validations: + required: true + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/OneSignal/api/blob/main/CONTRIBUTING.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 0000000..c16540f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,44 @@ + +# READ AND DELETE THIS SECTION BEFORE SUBMITTING PR +* **Fill out each _REQUIRED_ section** +* **Fill out _OPTIONAL_ sections, remove section if it doesn't apply to your PR** +* **Read and fill out each of the checklists below** +* **Remove this section after reading** + + +# Description +## One Line Summary +**REQUIRED** - Very short description that summaries the changes in this PR. + +## Details + +### Motivation +**REQUIRED -** Why is this code change being made? Or what is the goal of this PR? Examples: Fixes a specific bug, provides additional logging to debug future issues, feature to allow X. + +### Scope +**RECOMMEND - OPTIONAL -** What is intended to be effected. What is known not to change. Example: Notifications are grouped when parameter X is set, not enabled by default. + +### OPTIONAL - Other +**OPTIONAL -** Feel free to add any other sections or sub-sections that can explain your PR better. + +# Testing + +## Manual testing +**REQUIRED -** Explain what scenarios were tested and the environment. + + +# Checklist +## Overview + - [ ] I have filled out all **REQUIRED** sections above + - [ ] PR does one thing + - If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR + - [ ] Any Public API changes are explained in the PR details and conform to existing APIs + +## Testing + - [ ] I have personally tested this on my device, or explained why that is not possible + +## Final pass + - [ ] Code is as readable as possible. + - Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code. + - [ ] I have reviewed this PR myself, ensuring it meets each checklist item + - WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this. \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 05a17cb..0000000 --- a/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by: https://openapi-generator.tech -# - -*.gem -*.rbc -/.config -/coverage/ -/InstalledFiles -/pkg/ -/spec/reports/ -/spec/examples.txt -/test/tmp/ -/test/version_tmp/ -/tmp/ - -## Specific to RubyMotion: -.dat* -.repl_history -build/ - -## Documentation cache and generated files: -/.yardoc/ -/_yardoc/ -/doc/ -/rdoc/ - -## Environment normalization: -/.bundle/ -/vendor/bundle -/lib/bundler/man/ - -# for a library or gem, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# Gemfile.lock -# .ruby-version -# .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore deleted file mode 100644 index 7484ee5..0000000 --- a/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES deleted file mode 100644 index a6b9bdb..0000000 --- a/.openapi-generator/FILES +++ /dev/null @@ -1,126 +0,0 @@ -.gitignore -.openapi-generator-ignore -.rspec -.rubocop.yml -.travis.yml -Gemfile -README.md -Rakefile -docs/App.md -docs/Button.md -docs/DefaultApi.md -docs/DeliveryData.md -docs/ExportPlayersRequestBody.md -docs/Filter.md -docs/FilterExpressions.md -docs/FilterNotificationTarget.md -docs/GetNotificationRequestBody.md -docs/InlineResponse200.md -docs/InlineResponse2001.md -docs/InlineResponse2002.md -docs/InlineResponse2003.md -docs/InlineResponse2004.md -docs/InlineResponse2005.md -docs/InlineResponse201.md -docs/InlineResponse400.md -docs/InlineResponse4001.md -docs/InlineResponse4002.md -docs/InlineResponse409.md -docs/Notification.md -docs/NotificationAllOf.md -docs/NotificationAllOfAndroidBackgroundLayout.md -docs/NotificationSlice.md -docs/NotificationTarget.md -docs/Operator.md -docs/OutcomeData.md -docs/PlatformDeliveryData.md -docs/Player.md -docs/PlayerNotificationTarget.md -docs/PlayerSlice.md -docs/Purchase.md -docs/Segment.md -docs/SegmentNotificationTarget.md -docs/StringMap.md -docs/UpdatePlayerTagsRequestBody.md -git_push.sh -lib/onesignal.rb -lib/onesignal/api/default_api.rb -lib/onesignal/api_client.rb -lib/onesignal/api_error.rb -lib/onesignal/configuration.rb -lib/onesignal/models/app.rb -lib/onesignal/models/button.rb -lib/onesignal/models/delivery_data.rb -lib/onesignal/models/export_players_request_body.rb -lib/onesignal/models/filter.rb -lib/onesignal/models/filter_expressions.rb -lib/onesignal/models/filter_notification_target.rb -lib/onesignal/models/get_notification_request_body.rb -lib/onesignal/models/inline_response200.rb -lib/onesignal/models/inline_response2001.rb -lib/onesignal/models/inline_response2002.rb -lib/onesignal/models/inline_response2003.rb -lib/onesignal/models/inline_response2004.rb -lib/onesignal/models/inline_response2005.rb -lib/onesignal/models/inline_response201.rb -lib/onesignal/models/inline_response400.rb -lib/onesignal/models/inline_response4001.rb -lib/onesignal/models/inline_response4002.rb -lib/onesignal/models/inline_response409.rb -lib/onesignal/models/notification.rb -lib/onesignal/models/notification_all_of.rb -lib/onesignal/models/notification_all_of_android_background_layout.rb -lib/onesignal/models/notification_slice.rb -lib/onesignal/models/notification_target.rb -lib/onesignal/models/operator.rb -lib/onesignal/models/outcome_data.rb -lib/onesignal/models/platform_delivery_data.rb -lib/onesignal/models/player.rb -lib/onesignal/models/player_notification_target.rb -lib/onesignal/models/player_slice.rb -lib/onesignal/models/purchase.rb -lib/onesignal/models/segment.rb -lib/onesignal/models/segment_notification_target.rb -lib/onesignal/models/string_map.rb -lib/onesignal/models/update_player_tags_request_body.rb -lib/onesignal/version.rb -onesignal.gemspec -spec/api/default_api_spec.rb -spec/api_client_spec.rb -spec/configuration_spec.rb -spec/models/app_spec.rb -spec/models/button_spec.rb -spec/models/delivery_data_spec.rb -spec/models/export_players_request_body_spec.rb -spec/models/filter_expressions_spec.rb -spec/models/filter_notification_target_spec.rb -spec/models/filter_spec.rb -spec/models/get_notification_request_body_spec.rb -spec/models/inline_response2001_spec.rb -spec/models/inline_response2002_spec.rb -spec/models/inline_response2003_spec.rb -spec/models/inline_response2004_spec.rb -spec/models/inline_response2005_spec.rb -spec/models/inline_response200_spec.rb -spec/models/inline_response201_spec.rb -spec/models/inline_response4001_spec.rb -spec/models/inline_response4002_spec.rb -spec/models/inline_response400_spec.rb -spec/models/inline_response409_spec.rb -spec/models/notification_all_of_android_background_layout_spec.rb -spec/models/notification_all_of_spec.rb -spec/models/notification_slice_spec.rb -spec/models/notification_spec.rb -spec/models/notification_target_spec.rb -spec/models/operator_spec.rb -spec/models/outcome_data_spec.rb -spec/models/platform_delivery_data_spec.rb -spec/models/player_notification_target_spec.rb -spec/models/player_slice_spec.rb -spec/models/player_spec.rb -spec/models/purchase_spec.rb -spec/models/segment_notification_target_spec.rb -spec/models/segment_spec.rb -spec/models/string_map_spec.rb -spec/models/update_player_tags_request_body_spec.rb -spec/spec_helper.rb diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION deleted file mode 100644 index 6555596..0000000 --- a/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.2.0-SNAPSHOT \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 636db68..0000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: ruby -cache: bundler -rvm: - - 2.7.4 -script: - - bundle install --path vendor/bundle - - bundle exec rspec - - gem build onesignal.gemspec - - gem install ./onesignal-1.0.0.gem diff --git a/LICENSE b/LICENSE index c05c7d3..48fd45d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ Modified MIT License -Copyright 2021 OneSignal +Copyright 2022 OneSignal Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index ba68ee8..2c47b85 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,4 @@ -

Welcome to the official OneSignal Ruby Client 👋

- -[![Gem Version][rgb]][rgl] - -

- - Documentation - - - Maintenance - - - Twitter: onesignal - -

- +# onesignal OneSignal - the Ruby gem for the OneSignal @@ -21,54 +6,75 @@ A powerful way to send personalized messages at scale and build effective custom This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -OneSignal is a simple ruby wrapper for the [OneSignal API][osa]. +- API version: 1.0.1 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.RubyClientCodegen +For more information, please visit [https://onesignal.com](https://onesignal.com) -### 🖤 [RubyGems](https://rubygems.org/gems/onesignal) +## Installation -## 🚧 In Beta 🚧 +### Build a gem -## Installation +To build the Ruby code into a gem: -Add this line to your application's Gemfile: +```shell +gem build onesignal.gemspec +``` -```ruby -gem 'onesignal', '~> 1.0.0.beta1' +Then either install the gem locally: + +```shell +gem install ./onesignal-1.0.0.gem ``` -And then execute: +(for development, run `gem install --dev ./onesignal-1.0.0.gem` to install the development dependencies) + +or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). + +Finally add this to the Gemfile: + + gem 'onesignal', '~> 1.0.0' + +### Install from Git + +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: - $ bundle + gem 'onesignal', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' -Or install it yourself as: +### Include the Ruby code directly - $ gem install onesignal --pre +Include the Ruby code directly using `-I` as follows: -Or install from Github: - $ gem "onesignal", '~> 1.0.0.beta1', git: 'git://github.com/OneSignal/onesignal-ruby-client.git' +```shell +ruby -Ilib script.rb +``` ## Getting Started Please follow the [installation](#installation) procedure and then run the following code: ```ruby -require 'time' +# Load the gem require 'onesignal' -# setup authorization + +# Setup authorization OneSignal.configure do |config| # Configure Bearer authorization: app_key - config.access_token = 'YOUR BEARER TOKEN' # Change this + config.access_token = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new -notification = OneSignal::Notification.new({app_id: 'YOUR APP ID'}) # Notification +app_id = 'app_id_example' # String | +notification_id = 'notification_id_example' # String | begin - # Create notification - result = api_instance.create_notification(notification) + #Stop a scheduled or currently outgoing notification + result = api_instance.cancel_notification(app_id, notification_id) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->create_notification: #{e}" + puts "Exception when calling DefaultApi->cancel_notification: #{e}" end + ``` ## Documentation for API Endpoints @@ -111,21 +117,26 @@ Class | Method | HTTP request | Description - [OneSignal::InlineResponse200](docs/InlineResponse200.md) - [OneSignal::InlineResponse2001](docs/InlineResponse2001.md) - [OneSignal::InlineResponse2002](docs/InlineResponse2002.md) - - [OneSignal::InlineResponse2003](docs/InlineResponse2003.md) - - [OneSignal::InlineResponse2004](docs/InlineResponse2004.md) - [OneSignal::InlineResponse2005](docs/InlineResponse2005.md) + - [OneSignal::InlineResponse2007](docs/InlineResponse2007.md) + - [OneSignal::InlineResponse2008](docs/InlineResponse2008.md) - [OneSignal::InlineResponse201](docs/InlineResponse201.md) - [OneSignal::InlineResponse400](docs/InlineResponse400.md) - [OneSignal::InlineResponse4001](docs/InlineResponse4001.md) - [OneSignal::InlineResponse4002](docs/InlineResponse4002.md) - - [OneSignal::InlineResponse409](docs/InlineResponse409.md) + - [OneSignal::InlineResponse4003](docs/InlineResponse4003.md) + - [OneSignal::InvalidIdentifierError](docs/InvalidIdentifierError.md) - [OneSignal::Notification](docs/Notification.md) + - [OneSignal::Notification200Errors](docs/Notification200Errors.md) - [OneSignal::NotificationAllOf](docs/NotificationAllOf.md) - [OneSignal::NotificationAllOfAndroidBackgroundLayout](docs/NotificationAllOfAndroidBackgroundLayout.md) - [OneSignal::NotificationSlice](docs/NotificationSlice.md) - [OneSignal::NotificationTarget](docs/NotificationTarget.md) + - [OneSignal::NotificationWithMeta](docs/NotificationWithMeta.md) + - [OneSignal::NotificationWithMetaAllOf](docs/NotificationWithMetaAllOf.md) - [OneSignal::Operator](docs/Operator.md) - [OneSignal::OutcomeData](docs/OutcomeData.md) + - [OneSignal::OutcomesData](docs/OutcomesData.md) - [OneSignal::PlatformDeliveryData](docs/PlatformDeliveryData.md) - [OneSignal::Player](docs/Player.md) - [OneSignal::PlayerNotificationTarget](docs/PlayerNotificationTarget.md) @@ -148,30 +159,3 @@ Class | Method | HTTP request | Description - **Type**: Bearer authentication -## License - -The gem is available as open source under the terms of the [MIT License][mit]. - -[rgb]: https://img.shields.io/gem/v/onesignal.svg -[rgl]: https://rubygems.org/gems/onesignal -[osa]: https://documentation.onesignal.com/reference/ -[mit]: http://opensource.org/licenses/MIT - -## Author - -* Website: https://onesignal.com -* Twitter: [@onesignal](https://twitter.com/onesignal) -* Github: [@OneSignal](https://github.com/OneSignal) - -## 🤝 Contributing - -Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/OneSignal/onesignal-ruby-client/issues). - -## Show your support - -Give a ⭐️ if this project helped you! - -## 📝 License - -Copyright © 2022 [OneSignal](https://github.com/OneSignal).
-This project is [MIT](https://opensource.org/licenses/MIT) licensed. diff --git a/bin/console b/bin/console deleted file mode 100755 index 9d022ea..0000000 --- a/bin/console +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env ruby - -require 'bundler/setup' -require 'onesignal' - -# You can add fixtures and/or initialization code here to make experimenting -# with your gem easier. You can also use a different console, if you like. - -# (If you use this, don't forget to add pry to your Gemfile!) -# require "pry" -# Pry.start - -require 'irb' -IRB.start diff --git a/bin/setup b/bin/setup deleted file mode 100755 index dce67d8..0000000 --- a/bin/setup +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -IFS=$'\n\t' -set -vx - -bundle install - -# Do any other automated setup that you need to do here diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index baf7607..4ba0c8f 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -236,11 +236,11 @@ end ## create_player -> create_player(player) +> create_player(player) Add a device -Register a new device to one of your OneSignal apps 🚧 Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. 🚧 iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. +Register a new device to one of your OneSignal apps 🚧 Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. 🚧 iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. ### Examples @@ -254,7 +254,7 @@ OneSignal.configure do |config| end api_instance = OneSignal::DefaultApi.new -player = OneSignal::Player.new({id: 'id_example', app_id: 'app_id_example', device_type: 37}) # Player | +player = OneSignal::Player.new({id: 'id_example', device_type: 37}) # Player | begin # Add a device @@ -269,7 +269,7 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> create_player_with_http_info(player) +> , Integer, Hash)> create_player_with_http_info(player) ```ruby begin @@ -277,7 +277,7 @@ begin data, status_code, headers = api_instance.create_player_with_http_info(player) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->create_player_with_http_info: #{e}" end @@ -291,7 +291,7 @@ end ### Return type -[**InlineResponse2004**](InlineResponse2004.md) +[**InlineResponse2005**](InlineResponse2005.md) ### Authorization @@ -309,7 +309,7 @@ end Create Segments -Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. +Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. ### Examples @@ -378,7 +378,7 @@ end ## delete_player -> delete_player(app_id, player_id) +> delete_player(app_id, player_id) Delete a user record @@ -412,7 +412,7 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> delete_player_with_http_info(app_id, player_id) +> , Integer, Hash)> delete_player_with_http_info(app_id, player_id) ```ruby begin @@ -420,7 +420,7 @@ begin data, status_code, headers = api_instance.delete_player_with_http_info(app_id, player_id) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->delete_player_with_http_info: #{e}" end @@ -435,7 +435,7 @@ end ### Return type -[**InlineResponse2001**](InlineResponse2001.md) +[**InlineResponse2007**](InlineResponse2007.md) ### Authorization @@ -449,7 +449,7 @@ end ## delete_segments -> delete_segments(app_id, segment_id) +> delete_segments(app_id, segment_id) Delete Segments @@ -483,7 +483,7 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> delete_segments_with_http_info(app_id, segment_id) +> , Integer, Hash)> delete_segments_with_http_info(app_id, segment_id) ```ruby begin @@ -491,7 +491,7 @@ begin data, status_code, headers = api_instance.delete_segments_with_http_info(app_id, segment_id) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->delete_segments_with_http_info: #{e}" end @@ -506,7 +506,7 @@ end ### Return type -[**InlineResponse2003**](InlineResponse2003.md) +[**InlineResponse2001**](InlineResponse2001.md) ### Authorization @@ -520,11 +520,11 @@ end ## export_players -> export_players(app_id, opts) +> export_players(app_id, opts) CSV export -Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | +Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | ### Examples @@ -556,7 +556,7 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> export_players_with_http_info(app_id, opts) +> , Integer, Hash)> export_players_with_http_info(app_id, opts) ```ruby begin @@ -564,7 +564,7 @@ begin data, status_code, headers = api_instance.export_players_with_http_info(app_id, opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->export_players_with_http_info: #{e}" end @@ -579,7 +579,7 @@ end ### Return type -[**InlineResponse2005**](InlineResponse2005.md) +[**InlineResponse2008**](InlineResponse2008.md) ### Authorization @@ -662,7 +662,7 @@ end ## get_apps -> String get_apps +> > get_apps View apps @@ -694,7 +694,7 @@ end This returns an Array which contains the response data, status code and headers. -> get_apps_with_http_info +> >, Integer, Hash)> get_apps_with_http_info ```ruby begin @@ -702,7 +702,7 @@ begin data, status_code, headers = api_instance.get_apps_with_http_info p status_code # => 2xx p headers # => { ... } - p data # => String + p data # => > rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->get_apps_with_http_info: #{e}" end @@ -714,7 +714,7 @@ This endpoint does not need any parameter. ### Return type -**String** +[**Array<App>**](App.md) ### Authorization @@ -728,7 +728,7 @@ This endpoint does not need any parameter. ## get_notification -> get_notification(app_id, notification_id) +> get_notification(app_id, notification_id) View notification @@ -762,7 +762,7 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> get_notification_with_http_info(app_id, notification_id) +> , Integer, Hash)> get_notification_with_http_info(app_id, notification_id) ```ruby begin @@ -770,7 +770,7 @@ begin data, status_code, headers = api_instance.get_notification_with_http_info(app_id, notification_id) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->get_notification_with_http_info: #{e}" end @@ -785,7 +785,7 @@ end ### Return type -[**Notification**](Notification.md) +[**NotificationWithMeta**](NotificationWithMeta.md) ### Authorization @@ -803,7 +803,7 @@ end Notification History --> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. +-> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. ### Examples @@ -890,7 +890,7 @@ end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | The app ID that you want to view notifications from opts = { - limit: 'limit_example', # String | How many notifications to return. Max is 50. Default is 50. + limit: 56, # Integer | How many notifications to return. Max is 50. Default is 50. offset: 56, # 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 } @@ -927,7 +927,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **app_id** | **String** | The app ID that you want to view notifications from | | -| **limit** | **String** | How many notifications to return. Max is 50. Default is 50. | [optional] | +| **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] | @@ -947,11 +947,11 @@ end ## get_outcomes -> > get_outcomes(app_id, outcome_names, opts) +> get_outcomes(app_id, outcome_names, opts) View Outcomes -View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. +View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. ### Examples @@ -966,9 +966,9 @@ end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. -outcome_names = 'outcome_names_example' # String | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the “os” prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum +outcome_names = 'outcome_names_example' # String | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum opts = { - outcome_names2: 'outcome_names_example', # String | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where “Sales, Purchase” is the custom outcomes with a comma in the name. + outcome_names2: 'outcome_names_example', # String | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. outcome_time_range: 'outcome_time_range_example', # String | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. outcome_platforms: 'outcome_platforms_example', # String | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. outcome_attribution: 'outcome_attribution_example' # String | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. @@ -987,7 +987,7 @@ end This returns an Array which contains the response data, status code and headers. -> >, Integer, Hash)> get_outcomes_with_http_info(app_id, outcome_names, opts) +> , Integer, Hash)> get_outcomes_with_http_info(app_id, outcome_names, opts) ```ruby begin @@ -995,7 +995,7 @@ begin data, status_code, headers = api_instance.get_outcomes_with_http_info(app_id, outcome_names, opts) p status_code # => 2xx p headers # => { ... } - p data # => > + p data # => rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->get_outcomes_with_http_info: #{e}" end @@ -1006,15 +1006,15 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | -| **outcome_names** | **String** | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the “os” prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum | | -| **outcome_names2** | **String** | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where “Sales, Purchase” is the custom outcomes with a comma in the name. | [optional] | +| **outcome_names** | **String** | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum | | +| **outcome_names2** | **String** | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. | [optional] | | **outcome_time_range** | **String** | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. | [optional] | | **outcome_platforms** | **String** | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. | [optional] | | **outcome_attribution** | **String** | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. | [optional] | ### Return type -[**Array<OutcomeData>**](OutcomeData.md) +[**OutcomesData**](OutcomesData.md) ### Authorization @@ -1123,7 +1123,7 @@ end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | The app ID that you want to view players from opts = { - limit: 'limit_example', # String | How many devices to return. Max is 300. Default is 300 + limit: 56, # Integer | How many devices to return. Max is 300. Default is 300 offset: 56 # Integer | Result offset. Default is 0. Results are sorted by id; } @@ -1159,7 +1159,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **app_id** | **String** | The app ID that you want to view players from | | -| **limit** | **String** | How many devices to return. Max is 300. Default is 300 | [optional] | +| **limit** | **Integer** | How many devices to return. Max is 300. Default is 300 | [optional] | | **offset** | **Integer** | Result offset. Default is 0. Results are sorted by id; | [optional] | ### Return type @@ -1268,7 +1268,7 @@ end api_instance = OneSignal::DefaultApi.new player_id = 'player_id_example' # String | Player's OneSignal ID -player = OneSignal::Player.new({id: 'id_example', app_id: 'app_id_example', device_type: 37}) # Player | +player = OneSignal::Player.new({id: 'id_example', device_type: 37}) # Player | begin # Edit device @@ -1320,11 +1320,11 @@ end ## update_player_tags -> update_player_tags(app_id, external_user_id, opts) +> update_player_tags(app_id, external_user_id, opts) Edit tags with external user id -Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. 📘 Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } +Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. 📘 Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } ### Examples @@ -1357,7 +1357,7 @@ end This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> update_player_tags_with_http_info(app_id, external_user_id, opts) +> , Integer, Hash)> update_player_tags_with_http_info(app_id, external_user_id, opts) ```ruby begin @@ -1365,7 +1365,7 @@ begin data, status_code, headers = api_instance.update_player_tags_with_http_info(app_id, external_user_id, opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e puts "Error when calling DefaultApi->update_player_tags_with_http_info: #{e}" end @@ -1381,7 +1381,7 @@ end ### Return type -[**InlineResponse2003**](InlineResponse2003.md) +[**InlineResponse2001**](InlineResponse2001.md) ### Authorization diff --git a/docs/InlineResponse200.md b/docs/InlineResponse200.md index fc1972e..e3278f1 100644 --- a/docs/InlineResponse200.md +++ b/docs/InlineResponse200.md @@ -7,7 +7,7 @@ | **id** | **String** | | | | **recipients** | **Integer** | Estimated number of subscribers targetted by notification. | | | **external_id** | **String** | | [optional] | -| **errors** | [**OneOfobjectarray**](OneOfobjectarray.md) | | [optional] | +| **errors** | [**Notification200Errors**](Notification200Errors.md) | | [optional] | ## Example diff --git a/docs/InlineResponse2001.md b/docs/InlineResponse2001.md index ab72962..ce7d682 100644 --- a/docs/InlineResponse2001.md +++ b/docs/InlineResponse2001.md @@ -4,7 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **success** | **String** | | [optional] | +| **success** | **Boolean** | | [optional] | ## Example diff --git a/docs/InlineResponse2002.md b/docs/InlineResponse2002.md index ed29ea8..b56d1e4 100644 --- a/docs/InlineResponse2002.md +++ b/docs/InlineResponse2002.md @@ -4,7 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **success** | **String** | | [optional] | +| **success** | **Boolean** | | [optional] | | **destination_url** | **String** | | [optional] | ## Example diff --git a/docs/InlineResponse2004.md b/docs/InlineResponse2004.md deleted file mode 100644 index fb1d90c..0000000 --- a/docs/InlineResponse2004.md +++ /dev/null @@ -1,20 +0,0 @@ -# OneSignal::InlineResponse2004 - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **success** | **Boolean** | | [optional] | -| **id** | **String** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::InlineResponse2004.new( - success: null, - id: null -) -``` - diff --git a/docs/InlineResponse2005.md b/docs/InlineResponse2005.md index 6edd9c3..bc25662 100644 --- a/docs/InlineResponse2005.md +++ b/docs/InlineResponse2005.md @@ -4,7 +4,8 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **csv_file_url** | **String** | | [optional] | +| **success** | **Boolean** | | [optional] | +| **id** | **String** | | [optional] | ## Example @@ -12,7 +13,8 @@ require 'onesignal' instance = OneSignal::InlineResponse2005.new( - csv_file_url: null + success: null, + id: null ) ``` diff --git a/docs/InlineResponse2003.md b/docs/InlineResponse2007.md similarity index 55% rename from docs/InlineResponse2003.md rename to docs/InlineResponse2007.md index c465b45..75abb45 100644 --- a/docs/InlineResponse2003.md +++ b/docs/InlineResponse2007.md @@ -1,17 +1,17 @@ -# OneSignal::InlineResponse2003 +# OneSignal::InlineResponse2007 ## Properties | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **success** | **Boolean** | | [optional] | +| **success** | **String** | | [optional] | ## Example ```ruby require 'onesignal' -instance = OneSignal::InlineResponse2003.new( +instance = OneSignal::InlineResponse2007.new( success: null ) ``` diff --git a/docs/InlineResponse2008.md b/docs/InlineResponse2008.md new file mode 100644 index 0000000..6c3a62d --- /dev/null +++ b/docs/InlineResponse2008.md @@ -0,0 +1,18 @@ +# OneSignal::InlineResponse2008 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **csv_file_url** | **String** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::InlineResponse2008.new( + csv_file_url: null +) +``` + diff --git a/docs/InlineResponse4002.md b/docs/InlineResponse4002.md index 848bbde..6f150f5 100644 --- a/docs/InlineResponse4002.md +++ b/docs/InlineResponse4002.md @@ -4,7 +4,8 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **erorrs** | **Array<String>** | | [optional] | +| **success** | **Boolean** | | [optional] | +| **errors** | **Array<String>** | | [optional] | ## Example @@ -12,7 +13,8 @@ require 'onesignal' instance = OneSignal::InlineResponse4002.new( - erorrs: null + success: null, + errors: null ) ``` diff --git a/docs/InlineResponse4003.md b/docs/InlineResponse4003.md new file mode 100644 index 0000000..9bf6b12 --- /dev/null +++ b/docs/InlineResponse4003.md @@ -0,0 +1,18 @@ +# OneSignal::InlineResponse4003 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **erorrs** | **Array<String>** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::InlineResponse4003.new( + erorrs: null +) +``` + diff --git a/docs/InlineResponse409.md b/docs/InlineResponse409.md deleted file mode 100644 index ada9064..0000000 --- a/docs/InlineResponse409.md +++ /dev/null @@ -1,20 +0,0 @@ -# OneSignal::InlineResponse409 - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **success** | **Boolean** | | [optional] | -| **errors** | **Array<String>** | | [optional] | - -## Example - -```ruby -require 'onesignal' - -instance = OneSignal::InlineResponse409.new( - success: null, - errors: null -) -``` - diff --git a/docs/InvalidIdentifierError.md b/docs/InvalidIdentifierError.md new file mode 100644 index 0000000..2521497 --- /dev/null +++ b/docs/InvalidIdentifierError.md @@ -0,0 +1,20 @@ +# OneSignal::InvalidIdentifierError + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **invalid_external_user_ids** | **Array<String>** | Returned if using include_external_user_ids | [optional] | +| **invalid_player_ids** | **Array<String>** | Returned if using include_player_ids and some were valid and others were not. | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::InvalidIdentifierError.new( + invalid_external_user_ids: null, + invalid_player_ids: null +) +``` + diff --git a/docs/Notification.md b/docs/Notification.md index 1499c99..cf0137a 100644 --- a/docs/Notification.md +++ b/docs/Notification.md @@ -19,7 +19,7 @@ | **email** | **String** | value = email address Only for sending Push Notifications Use this for targeting push subscribers associated with an email set with all SDK setEmail methods To send emails to specific email addresses use include_email_tokens parameter | [optional] | | **country** | **String** | relation = \"=\" value = 2-digit Country code Example: \"field\": \"country\", \"relation\": \"=\", \"value\", \"US\" | [optional] | | **include_player_ids** | **Array<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | -| **include_external_user_ids** | **Array<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [“custom-id-assigned-by-api”] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +| **include_external_user_ids** | **Array<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | | **include_email_tokens** | **Array<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | | **include_phone_numbers** | **Array<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | | **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | @@ -81,22 +81,22 @@ | **firefox_icon** | **String** | Channel: Push Notifications Platform: Firefox Not recommended Few people need to set Firefox-specific icons. We recommend setting chrome_web_icon instead, which Firefox will also use. Sets the web push notification's icon for Firefox. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. | [optional] | | **chrome_icon** | **String** | Channel: Push Notifications Platform: ChromeApp This flag is not used for web push For web push, please see chrome_web_icon instead. The local URL to an icon to use. If blank, the app icon will be used. | [optional] | | **ios_sound** | **String** | Channel: Push Notifications Platform: iOS Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable vibration and sound for the notification. Example: \"notification.wav\" | [optional] | -| **android_sound** | **String** | Channel: Push Notifications Platform: Android ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | -| **huawei_sound** | **String** | Channel: Push Notifications Platform: Huawei ⚠Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: \"/res/raw/notification\" | [optional] | -| **adm_sound** | **String** | Channel: Push Notifications Platform: Amazon ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | +| **android_sound** | **String** | Channel: Push Notifications Platform: Android &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | +| **huawei_sound** | **String** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: \"/res/raw/notification\" | [optional] | +| **adm_sound** | **String** | Channel: Push Notifications Platform: Amazon &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | | **wp_wns_sound** | **String** | Channel: Push Notifications Platform: Windows Sound file that is included in your app to play instead of the default device notification sound. Example: \"notification.wav\" | [optional] | -| **android_led_color** | **String** | Channel: Push Notifications Platform: Android ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): \"FF0000FF\" | [optional] | -| **huawei_led_color** | **String** | Channel: Push Notifications Platform: Huawei ⚠Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): \"0000FF\" | [optional] | +| **android_led_color** | **String** | Channel: Push Notifications Platform: Android &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): \"FF0000FF\" | [optional] | +| **huawei_led_color** | **String** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): \"0000FF\" | [optional] | | **android_accent_color** | **String** | Channel: Push Notifications Platform: Android Sets the background color of the notification circle to the left of the notification text. Only applies to apps targeting Android API level 21+ on Android 5.0+ devices. Example(Red): \"FFFF0000\" | [optional] | -| **huawei_accent_color** | **String** | Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device’s theme color if not set. | [optional] | -| **android_visibility** | **Integer** | Channel: Push Notifications Platform: Android 5.0_ ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | -| **huawei_visibility** | **Integer** | Channel: Push Notifications Platform: Huawei ⚠Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | +| **huawei_accent_color** | **String** | Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device's theme color if not set. | [optional] | +| **android_visibility** | **Integer** | Channel: Push Notifications Platform: Android 5.0_ &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | +| **huawei_visibility** | **Integer** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | | **ios_badge_type** | **String** | Channel: Push Notifications Platform: iOS Describes whether to set or increase/decrease your app's iOS badge count by the ios_badgeCount specified count. Can specify None, SetTo, or Increase. `None` leaves the count unaffected. `SetTo` directly sets the badge count to the number specified in ios_badgeCount. `Increase` adds the number specified in ios_badgeCount to the total. Use a negative number to decrease the badge count. | [optional] | | **ios_badge_count** | **Integer** | Channel: Push Notifications Platform: iOS Used with ios_badgeType, describes the value to set or amount to increase/decrease your app's iOS badge count by. You can use a negative number to decrease the badge count when used with an ios_badgeType of Increase. | [optional] | | **collapse_id** | **String** | Channel: Push Notifications Platform: iOS 10+, Android Only one notification with the same id will be shown on the device. Use the same id to update an existing notification instead of showing a new one. Limit of 64 characters. | [optional] | | **web_push_topic** | **String** | Channel: Push Notifications Platform: All Browsers Display multiple notifications at once with different topics. | [optional] | | **apns_alert** | **Object** | Channel: Push Notifications Platform: iOS 10+ iOS can localize push notification messages on the client using special parameters such as loc-key. When using the Create Notification endpoint, you must include these parameters inside of a field called apns_alert. Please see Apple's guide on localizing push notifications to learn more. | [optional] | -| **send_after** | **String** | Channel: All Schedule notification for future delivery. API defaults to UTC -1100 Examples: All examples are the exact same date & time. \"Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)\" \"September 24th 2015, 2:00:00 pm UTC-07:00\" \"2015-09-24 14:00:00 GMT-0700\" \"Sept 24 2015 14:00:00 GMT-0700\" \"Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)\" Note: SMS currently only supports send_after parameter. | [optional] | +| **send_after** | **Time** | Channel: All Schedule notification for future delivery. API defaults to UTC -1100 Examples: All examples are the exact same date & time. \"Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)\" \"September 24th 2015, 2:00:00 pm UTC-07:00\" \"2015-09-24 14:00:00 GMT-0700\" \"Sept 24 2015 14:00:00 GMT-0700\" \"Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)\" Note: SMS currently only supports send_after parameter. | [optional] | | **delayed_option** | **String** | Channel: All Possible values are: timezone (Deliver at a specific time-of-day in each users own timezone) last-active Same as Intelligent Delivery . (Deliver at the same time of day as each user last used your app). If send_after is used, this takes effect after the send_after time has elapsed. | [optional] | | **delivery_time_of_day** | **String** | Channel: All Use with delayed_option=timezone. Examples: \"9:00AM\" \"21:45\" \"9:45:30\" | [optional] | | **ttl** | **Integer** | Channel: Push Notifications Platform: iOS, Android, Chrome, Firefox, Safari, ChromeWeb Time To Live - In seconds. The notification will be expired if the device does not come back online within this time. The default is 259,200 seconds (3 days). Max value to set is 2419200 seconds (28 days). | [optional] | @@ -110,7 +110,7 @@ | **thread_id** | **String** | Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. | [optional] | | **summary_arg** | **String** | Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" | [optional] | | **summary_arg_count** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | -| **email_subect** | **String** | Channel: Email Required. The subject of the email. | [optional] | +| **email_subject** | **String** | Channel: Email Required. The subject of the email. | [optional] | | **email_body** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | | **email_from_name** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | | **email_from_address** | **String** | Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -229,7 +229,7 @@ instance = OneSignal::Notification.new( thread_id: null, summary_arg: null, summary_arg_count: null, - email_subect: null, + email_subject: null, email_body: null, email_from_name: null, email_from_address: null, diff --git a/docs/Notification200Errors.md b/docs/Notification200Errors.md new file mode 100644 index 0000000..a09ba9c --- /dev/null +++ b/docs/Notification200Errors.md @@ -0,0 +1,49 @@ +# OneSignal::Notification200Errors + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'onesignal' + +OneSignal::Notification200Errors.openapi_one_of +# => +# [ +# :'Array', +# :'InvalidIdentifierError' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'onesignal' + +OneSignal::Notification200Errors.build(data) +# => #:0x00007fdd4aab02a0> + +OneSignal::Notification200Errors.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Array` +- `InvalidIdentifierError` +- `nil` (if no type matches) + diff --git a/docs/NotificationAllOf.md b/docs/NotificationAllOf.md index 45e8b81..65bc15c 100644 --- a/docs/NotificationAllOf.md +++ b/docs/NotificationAllOf.md @@ -57,22 +57,22 @@ | **firefox_icon** | **String** | Channel: Push Notifications Platform: Firefox Not recommended Few people need to set Firefox-specific icons. We recommend setting chrome_web_icon instead, which Firefox will also use. Sets the web push notification's icon for Firefox. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. | [optional] | | **chrome_icon** | **String** | Channel: Push Notifications Platform: ChromeApp This flag is not used for web push For web push, please see chrome_web_icon instead. The local URL to an icon to use. If blank, the app icon will be used. | [optional] | | **ios_sound** | **String** | Channel: Push Notifications Platform: iOS Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable vibration and sound for the notification. Example: \"notification.wav\" | [optional] | -| **android_sound** | **String** | Channel: Push Notifications Platform: Android ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | -| **huawei_sound** | **String** | Channel: Push Notifications Platform: Huawei ⚠Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: \"/res/raw/notification\" | [optional] | -| **adm_sound** | **String** | Channel: Push Notifications Platform: Amazon ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | +| **android_sound** | **String** | Channel: Push Notifications Platform: Android &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | +| **huawei_sound** | **String** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: \"/res/raw/notification\" | [optional] | +| **adm_sound** | **String** | Channel: Push Notifications Platform: Amazon &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | | **wp_wns_sound** | **String** | Channel: Push Notifications Platform: Windows Sound file that is included in your app to play instead of the default device notification sound. Example: \"notification.wav\" | [optional] | -| **android_led_color** | **String** | Channel: Push Notifications Platform: Android ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): \"FF0000FF\" | [optional] | -| **huawei_led_color** | **String** | Channel: Push Notifications Platform: Huawei ⚠Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): \"0000FF\" | [optional] | +| **android_led_color** | **String** | Channel: Push Notifications Platform: Android &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): \"FF0000FF\" | [optional] | +| **huawei_led_color** | **String** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): \"0000FF\" | [optional] | | **android_accent_color** | **String** | Channel: Push Notifications Platform: Android Sets the background color of the notification circle to the left of the notification text. Only applies to apps targeting Android API level 21+ on Android 5.0+ devices. Example(Red): \"FFFF0000\" | [optional] | -| **huawei_accent_color** | **String** | Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device’s theme color if not set. | [optional] | -| **android_visibility** | **Integer** | Channel: Push Notifications Platform: Android 5.0_ ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | -| **huawei_visibility** | **Integer** | Channel: Push Notifications Platform: Huawei ⚠Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | +| **huawei_accent_color** | **String** | Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device's theme color if not set. | [optional] | +| **android_visibility** | **Integer** | Channel: Push Notifications Platform: Android 5.0_ &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | +| **huawei_visibility** | **Integer** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | | **ios_badge_type** | **String** | Channel: Push Notifications Platform: iOS Describes whether to set or increase/decrease your app's iOS badge count by the ios_badgeCount specified count. Can specify None, SetTo, or Increase. `None` leaves the count unaffected. `SetTo` directly sets the badge count to the number specified in ios_badgeCount. `Increase` adds the number specified in ios_badgeCount to the total. Use a negative number to decrease the badge count. | [optional] | | **ios_badge_count** | **Integer** | Channel: Push Notifications Platform: iOS Used with ios_badgeType, describes the value to set or amount to increase/decrease your app's iOS badge count by. You can use a negative number to decrease the badge count when used with an ios_badgeType of Increase. | [optional] | | **collapse_id** | **String** | Channel: Push Notifications Platform: iOS 10+, Android Only one notification with the same id will be shown on the device. Use the same id to update an existing notification instead of showing a new one. Limit of 64 characters. | [optional] | | **web_push_topic** | **String** | Channel: Push Notifications Platform: All Browsers Display multiple notifications at once with different topics. | [optional] | | **apns_alert** | **Object** | Channel: Push Notifications Platform: iOS 10+ iOS can localize push notification messages on the client using special parameters such as loc-key. When using the Create Notification endpoint, you must include these parameters inside of a field called apns_alert. Please see Apple's guide on localizing push notifications to learn more. | [optional] | -| **send_after** | **String** | Channel: All Schedule notification for future delivery. API defaults to UTC -1100 Examples: All examples are the exact same date & time. \"Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)\" \"September 24th 2015, 2:00:00 pm UTC-07:00\" \"2015-09-24 14:00:00 GMT-0700\" \"Sept 24 2015 14:00:00 GMT-0700\" \"Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)\" Note: SMS currently only supports send_after parameter. | [optional] | +| **send_after** | **Time** | Channel: All Schedule notification for future delivery. API defaults to UTC -1100 Examples: All examples are the exact same date & time. \"Thu Sep 24 2015 14:00:00 GMT-0700 (PDT)\" \"September 24th 2015, 2:00:00 pm UTC-07:00\" \"2015-09-24 14:00:00 GMT-0700\" \"Sept 24 2015 14:00:00 GMT-0700\" \"Thu Sep 24 2015 14:00:00 GMT-0700 (Pacific Daylight Time)\" Note: SMS currently only supports send_after parameter. | [optional] | | **delayed_option** | **String** | Channel: All Possible values are: timezone (Deliver at a specific time-of-day in each users own timezone) last-active Same as Intelligent Delivery . (Deliver at the same time of day as each user last used your app). If send_after is used, this takes effect after the send_after time has elapsed. | [optional] | | **delivery_time_of_day** | **String** | Channel: All Use with delayed_option=timezone. Examples: \"9:00AM\" \"21:45\" \"9:45:30\" | [optional] | | **ttl** | **Integer** | Channel: Push Notifications Platform: iOS, Android, Chrome, Firefox, Safari, ChromeWeb Time To Live - In seconds. The notification will be expired if the device does not come back online within this time. The default is 259,200 seconds (3 days). Max value to set is 2419200 seconds (28 days). | [optional] | @@ -86,7 +86,7 @@ | **thread_id** | **String** | Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. | [optional] | | **summary_arg** | **String** | Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" | [optional] | | **summary_arg_count** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | -| **email_subect** | **String** | Channel: Email Required. The subject of the email. | [optional] | +| **email_subject** | **String** | Channel: Email Required. The subject of the email. | [optional] | | **email_body** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | | **email_from_name** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | | **email_from_address** | **String** | Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings. | [optional] | @@ -181,7 +181,7 @@ instance = OneSignal::NotificationAllOf.new( thread_id: null, summary_arg: null, summary_arg_count: null, - email_subect: null, + email_subject: null, email_body: null, email_from_name: null, email_from_address: null, diff --git a/docs/NotificationSlice.md b/docs/NotificationSlice.md index aad4200..255a6df 100644 --- a/docs/NotificationSlice.md +++ b/docs/NotificationSlice.md @@ -7,7 +7,7 @@ | **total_count** | **Integer** | | [optional] | | **offset** | **Integer** | | [optional] | | **limit** | **Integer** | | [optional] | -| **notifications** | [**Array<Notification>**](Notification.md) | | [optional] | +| **notifications** | [**Array<NotificationWithMeta>**](NotificationWithMeta.md) | | [optional] | ## Example diff --git a/docs/NotificationTarget.md b/docs/NotificationTarget.md index 523d9ef..f7dea02 100644 --- a/docs/NotificationTarget.md +++ b/docs/NotificationTarget.md @@ -19,7 +19,7 @@ | **email** | **String** | value = email address Only for sending Push Notifications Use this for targeting push subscribers associated with an email set with all SDK setEmail methods To send emails to specific email addresses use include_email_tokens parameter | [optional] | | **country** | **String** | relation = \"=\" value = 2-digit Country code Example: \"field\": \"country\", \"relation\": \"=\", \"value\", \"US\" | [optional] | | **include_player_ids** | **Array<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | -| **include_external_user_ids** | **Array<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [“custom-id-assigned-by-api”] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +| **include_external_user_ids** | **Array<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | | **include_email_tokens** | **Array<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | | **include_phone_numbers** | **Array<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | | **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | diff --git a/docs/NotificationWithMeta.md b/docs/NotificationWithMeta.md new file mode 100644 index 0000000..42507b1 --- /dev/null +++ b/docs/NotificationWithMeta.md @@ -0,0 +1,260 @@ +# OneSignal::NotificationWithMeta + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **included_segments** | **Array<String>** | The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | +| **excluded_segments** | **Array<String>** | Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] | [optional] | +| **last_session** | **String** | relation = \">\" or \"<\" hours_ago = number of hours before or after the users last session. Example: \"1.1\" | [optional] | +| **first_session** | **String** | relation = \">\" or \"<\" hours_ago = number of hours before or after the users first session. Example: \"1.1\" | [optional] | +| **session_count** | **String** | relation = \">\", \"<\", \"=\" or \"!=\" value = number sessions. Example: \"1\" | [optional] | +| **session_time** | **String** | relation = \">\", \"<\", \"=\" or \"!=\" value = Time in seconds the user has been in your app. Example: \"3600\" | [optional] | +| **amount_spent** | **String** | relation = \">\", \"<\", or \"=\" value = Amount in USD a user has spent on IAP (In App Purchases). Example: \"0.99\" | [optional] | +| **bought_sku** | **String** | relation = \">\", \"<\" or \"=\" key = SKU purchased in your app as an IAP (In App Purchases). Example: \"com.domain.100coinpack\" value = value of SKU to compare to. Example: \"0.99\" | [optional] | +| **tag** | **String** | relation = \">\", \"<\", \"=\", \"!=\", \"exists\", \"not_exists\", \"time_elapsed_gt\" (paid plan only) or \"time_elapsed_lt\" (paid plan only) See Time Operators key = Tag key to compare. value = Tag value to compare. Not required for \"exists\" or \"not_exists\". Example: See Formatting Filters | [optional] | +| **language** | **String** | relation = \"=\" or \"!=\" value = 2 character language code. Example: \"en\". For a list of all language codes see Language & Localization. | [optional] | +| **app_version** | **String** | relation = \">\", \"<\", \"=\" or \"!=\" value = app version. Example: \"1.0.0\" | [optional] | +| **location** | **String** | radius = in meters lat = latitude long = longitude | [optional] | +| **email** | **String** | value = email address Only for sending Push Notifications Use this for targeting push subscribers associated with an email set with all SDK setEmail methods To send emails to specific email addresses use include_email_tokens parameter | [optional] | +| **country** | **String** | relation = \"=\" value = 2-digit Country code Example: \"field\": \"country\", \"relation\": \"=\", \"value\", \"US\" | [optional] | +| **include_player_ids** | **Array<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | +| **include_external_user_ids** | **Array<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +| **include_email_tokens** | **Array<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | +| **include_phone_numbers** | **Array<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | +| **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | +| **include_wp_wns_uris** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call | [optional] | +| **include_amazon_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call | [optional] | +| **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **id** | **String** | | [optional] | +| **value** | **Integer** | | [optional][readonly] | +| **aggregation** | **String** | | [optional][readonly] | +| **is_ios** | **Boolean** | Indicates whether to send to all devices registered under your app's Apple iOS platform. | [optional][default to true] | +| **is_android** | **Boolean** | Indicates whether to send to all devices registered under your app's Google Android platform. | [optional] | +| **is_huawei** | **Boolean** | Indicates whether to send to all devices registered under your app's Huawei Android platform. | [optional] | +| **is_any_web** | **Boolean** | Indicates whether to send to all subscribed web browser users, including Chrome, Firefox, and Safari. You may use this instead as a combined flag instead of separately enabling isChromeWeb, isFirefox, and isSafari, though the three options are equivalent to this one. | [optional] | +| **is_chrome_web** | **Boolean** | Indicates whether to send to all Google Chrome, Chrome on Android, and Mozilla Firefox users registered under your Chrome & Firefox web push platform. | [optional] | +| **is_firefox** | **Boolean** | Indicates whether to send to all Mozilla Firefox desktop users registered under your Firefox web push platform. | [optional] | +| **is_safari** | **Boolean** | Does not support iOS Safari. Indicates whether to send to all Apple's Safari desktop users registered under your Safari web push platform. Read more iOS Safari | [optional] | +| **is_wp_wns** | **Boolean** | Indicates whether to send to all devices registered under your app's Windows platform. | [optional] | +| **is_adm** | **Boolean** | Indicates whether to send to all devices registered under your app's Amazon Fire platform. | [optional] | +| **is_chrome** | **Boolean** | This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. | [optional] | +| **channel_for_external_user_ids** | **String** | Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. | [optional] | +| **app_id** | **String** | Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. | | +| **external_id** | **String** | Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true | [optional] | +| **contents** | [**StringMap**](StringMap.md) | | [optional] | +| **headings** | [**StringMap**](StringMap.md) | | [optional] | +| **subtitle** | [**StringMap**](StringMap.md) | | [optional] | +| **data** | **Object** | Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1} | [optional] | +| **huawei_msg_type** | **String** | Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications. | [optional] | +| **url** | **String** | Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: https://onesignal.com | [optional] | +| **web_url** | **String** | Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including Chrome, Firefox, Safari, Opera, etc. Example: https://onesignal.com | [optional] | +| **app_url** | **String** | Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including iOS, Android, macOS, Windows, ChromeApps, etc. Example: https://onesignal.com | [optional] | +| **ios_attachments** | **Object** | Channel: Push Notifications Platform: iOS 10+ Adds media attachments to notifications. Set as JSON object, key as a media id of your choice and the value as a valid local filename or URL. User must press and hold on the notification to view. Do not set mutable_content to download attachments. The OneSignal SDK does this automatically Example: {\"id1\": \"https://domain.com/image.jpg\"} | [optional] | +| **template_id** | **String** | Channel: Push Notifications Platform: All Use a template you setup on our dashboard. The template_id is the UUID found in the URL when viewing a template on our dashboard. Example: be4a8044-bbd6-11e4-a581-000c2940e62c | [optional] | +| **content_available** | **Boolean** | Channel: Push Notifications Platform: iOS Sending true wakes your app from background to run custom native code (Apple interprets this as content-available=1). Note: Not applicable if the app is in the \"force-quit\" state (i.e app was swiped away). Omit the contents field to prevent displaying a visible notification. | [optional] | +| **mutable_content** | **Boolean** | Channel: Push Notifications Platform: iOS 10+ Always defaults to true and cannot be turned off. Allows tracking of notification receives and changing of the notification content in your app before it is displayed. Triggers didReceive(_:withContentHandler:) on your UNNotificationServiceExtension. | [optional] | +| **target_content_identifier** | **String** | Channel: Push Notifications Platform: iOS 13+ Use to target a specific experience in your App Clip, or to target your notification to a specific window in a multi-scene App. | [optional] | +| **big_picture** | **String** | Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. | [optional] | +| **huawei_big_picture** | **String** | Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. | [optional] | +| **adm_big_picture** | **String** | Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. | [optional] | +| **chrome_big_picture** | **String** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] | +| **chrome_web_image** | **String** | Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. | [optional] | +| **buttons** | [**Array<Button>**](Button.md) | Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}] | [optional] | +| **web_buttons** | [**Array<Button>**](Button.md) | Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] | [optional] | +| **ios_category** | **String** | Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. | [optional] | +| **android_channel_id** | **String** | Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | +| **huawei_channel_id** | **String** | Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. | [optional] | +| **existing_android_channel_id** | **String** | Channel: Push Notifications Platform: Android Use this if you have client side Android Oreo Channels you have already defined in your app with code. | [optional] | +| **huawei_existing_channel_id** | **String** | Channel: Push Notifications Platform: Huawei Use this if you have client side Android Oreo Channels you have already defined in your app with code. | [optional] | +| **android_background_layout** | [**NotificationAllOfAndroidBackgroundLayout**](NotificationAllOfAndroidBackgroundLayout.md) | | [optional] | +| **small_icon** | **String** | Channel: Push Notifications Platform: Android Icon shown in the status bar and on the top left of the notification. If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons | [optional] | +| **huawei_small_icon** | **String** | Channel: Push Notifications Platform: Huawei Icon shown in the status bar and on the top left of the notification. Use an Android resource path (E.g. /drawable/small_icon). Defaults to your app icon if not set. | [optional] | +| **large_icon** | **String** | Channel: Push Notifications Platform: Android Can be a drawable resource name or a URL. See: How to create large icons | [optional] | +| **huawei_large_icon** | **String** | Channel: Push Notifications Platform: Huawei Can be a drawable resource name or a URL. See: How to create large icons | [optional] | +| **adm_small_icon** | **String** | Channel: Push Notifications Platform: Amazon If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons | [optional] | +| **adm_large_icon** | **String** | Channel: Push Notifications Platform: Amazon If blank the small_icon is used. Can be a drawable resource name or a URL. See: How to create large icons | [optional] | +| **chrome_web_icon** | **String** | Channel: Push Notifications Platform: Chrome Sets the web push notification's icon. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. Firefox will also use this icon, unless you specify firefox_icon. | [optional] | +| **chrome_web_badge** | **String** | Channel: Push Notifications Platform: Chrome Sets the web push notification icon for Android devices in the notification shade. Please see Web Push Notification Badge. | [optional] | +| **firefox_icon** | **String** | Channel: Push Notifications Platform: Firefox Not recommended Few people need to set Firefox-specific icons. We recommend setting chrome_web_icon instead, which Firefox will also use. Sets the web push notification's icon for Firefox. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. | [optional] | +| **chrome_icon** | **String** | Channel: Push Notifications Platform: ChromeApp This flag is not used for web push For web push, please see chrome_web_icon instead. The local URL to an icon to use. If blank, the app icon will be used. | [optional] | +| **ios_sound** | **String** | Channel: Push Notifications Platform: iOS Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable vibration and sound for the notification. Example: \"notification.wav\" | [optional] | +| **android_sound** | **String** | Channel: Push Notifications Platform: Android &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | +| **huawei_sound** | **String** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: \"/res/raw/notification\" | [optional] | +| **adm_sound** | **String** | Channel: Push Notifications Platform: Amazon &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" | [optional] | +| **wp_wns_sound** | **String** | Channel: Push Notifications Platform: Windows Sound file that is included in your app to play instead of the default device notification sound. Example: \"notification.wav\" | [optional] | +| **android_led_color** | **String** | Channel: Push Notifications Platform: Android &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): \"FF0000FF\" | [optional] | +| **huawei_led_color** | **String** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): \"0000FF\" | [optional] | +| **android_accent_color** | **String** | Channel: Push Notifications Platform: Android Sets the background color of the notification circle to the left of the notification text. Only applies to apps targeting Android API level 21+ on Android 5.0+ devices. Example(Red): \"FFFF0000\" | [optional] | +| **huawei_accent_color** | **String** | Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device's theme color if not set. | [optional] | +| **android_visibility** | **Integer** | Channel: Push Notifications Platform: Android 5.0_ &#9888;&#65039;Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | +| **huawei_visibility** | **Integer** | Channel: Push Notifications Platform: Huawei &#9888;&#65039;Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) | [optional] | +| **ios_badge_type** | **String** | Channel: Push Notifications Platform: iOS Describes whether to set or increase/decrease your app's iOS badge count by the ios_badgeCount specified count. Can specify None, SetTo, or Increase. `None` leaves the count unaffected. `SetTo` directly sets the badge count to the number specified in ios_badgeCount. `Increase` adds the number specified in ios_badgeCount to the total. Use a negative number to decrease the badge count. | [optional] | +| **ios_badge_count** | **Integer** | Channel: Push Notifications Platform: iOS Used with ios_badgeType, describes the value to set or amount to increase/decrease your app's iOS badge count by. You can use a negative number to decrease the badge count when used with an ios_badgeType of Increase. | [optional] | +| **collapse_id** | **String** | Channel: Push Notifications Platform: iOS 10+, Android Only one notification with the same id will be shown on the device. Use the same id to update an existing notification instead of showing a new one. Limit of 64 characters. | [optional] | +| **web_push_topic** | **String** | Channel: Push Notifications Platform: All Browsers Display multiple notifications at once with different topics. | [optional] | +| **apns_alert** | **Object** | Channel: Push Notifications Platform: iOS 10+ iOS can localize push notification messages on the client using special parameters such as loc-key. When using the Create Notification endpoint, you must include these parameters inside of a field called apns_alert. Please see Apple's guide on localizing push notifications to learn more. | [optional] | +| **send_after** | **Integer** | Unix timestamp indicating when notification delivery should begin. | [optional] | +| **delayed_option** | **String** | Channel: All Possible values are: timezone (Deliver at a specific time-of-day in each users own timezone) last-active Same as Intelligent Delivery . (Deliver at the same time of day as each user last used your app). If send_after is used, this takes effect after the send_after time has elapsed. | [optional] | +| **delivery_time_of_day** | **String** | Channel: All Use with delayed_option=timezone. Examples: \"9:00AM\" \"21:45\" \"9:45:30\" | [optional] | +| **ttl** | **Integer** | Channel: Push Notifications Platform: iOS, Android, Chrome, Firefox, Safari, ChromeWeb Time To Live - In seconds. The notification will be expired if the device does not come back online within this time. The default is 259,200 seconds (3 days). Max value to set is 2419200 seconds (28 days). | [optional] | +| **priority** | **Integer** | Channel: Push Notifications Platform: Android, Chrome, ChromeWeb Delivery priority through the push server (example GCM/FCM). Pass 10 for high priority or any other integer for normal priority. Defaults to normal priority for Android and high for iOS. For Android 6.0+ devices setting priority to high will wake the device out of doze mode. | [optional] | +| **apns_push_type_override** | **String** | Channel: Push Notifications Platform: iOS valid values: voip Set the value to voip for sending VoIP Notifications This field maps to the APNS header apns-push-type. Note: alert and background are automatically set by OneSignal | [optional] | +| **throttle_rate_per_minute** | **Integer** | number of push notifications sent per minute. Paid Feature Only. If throttling is not enabled for the app or the notification, and for free accounts, null is returned. Refer to Throttling for more details. | [optional] | +| **android_group** | **String** | Channel: Push Notifications Platform: Android Notifications with the same group will be stacked together using Android's Notification Grouping feature. | [optional] | +| **android_group_message** | **String** | Channel: Push Notifications Platform: Android Note: This only works for Android 6 and older. Android 7+ allows full expansion of all message. Summary message to display when 2+ notifications are stacked together. Default is \"# new messages\". Include $[notif_count] in your message and it will be replaced with the current number. Languages - The value of each key is the message that will be sent to users for that language. \"en\" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. Read more: supported languages. Example: {\"en\": \"You have $[notif_count] new messages\"} | [optional] | +| **adm_group** | **String** | Channel: Push Notifications Platform: Amazon Notifications with the same group will be stacked together using Android's Notification Grouping feature. | [optional] | +| **adm_group_message** | **Object** | Channel: Push Notifications Platform: Amazon Summary message to display when 2+ notifications are stacked together. Default is \"# new messages\". Include $[notif_count] in your message and it will be replaced with the current number. \"en\" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. The value of each key is the message that will be sent to users for that language. Example: {\"en\": \"You have $[notif_count] new messages\"} | [optional] | +| **thread_id** | **String** | Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. | [optional] | +| **summary_arg** | **String** | Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" | [optional] | +| **summary_arg_count** | **Integer** | Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" | [optional] | +| **email_subject** | **String** | Channel: Email Required. The subject of the email. | [optional] | +| **email_body** | **String** | Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. | [optional] | +| **email_from_name** | **String** | Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. | [optional] | +| **email_from_address** | **String** | Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings. | [optional] | +| **sms_from** | **String** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional] | +| **sms_media_urls** | **Array<String>** | Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. | [optional] | +| **successful** | **Integer** | Number of notifications that were successfully delivered. | [optional] | +| **failed** | **Integer** | Number of notifications that could not be delivered due to those devices being unsubscribed. | [optional] | +| **errored** | **Integer** | Number of notifications that could not be delivered due to an error. You can find more information by viewing the notification in the dashboard. | [optional] | +| **converted** | **Integer** | Number of users who have clicked / tapped on your notification. | [optional] | +| **received** | **Integer** | Confirmed Deliveries number of devices that received the push notification. Paid Feature Only. Free accounts will see 0. | [optional] | +| **outcomes** | [**Array<OutcomeData>**](OutcomeData.md) | | [optional] | +| **remaining** | **Integer** | Number of notifications that have not been sent out yet. This can mean either our system is still processing the notification or you have delayed options set. | [optional] | +| **queued_at** | **Integer** | Unix timestamp indicating when the notification was created. | [optional] | +| **completed_at** | **Integer** | Unix timestamp indicating when notification delivery completed. The delivery duration from start to finish can be calculated with completed_at - send_after. | [optional] | +| **platform_delivery_stats** | [**PlatformDeliveryData**](PlatformDeliveryData.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::NotificationWithMeta.new( + included_segments: null, + excluded_segments: null, + last_session: null, + first_session: null, + session_count: null, + session_time: null, + amount_spent: null, + bought_sku: null, + tag: null, + language: null, + app_version: null, + location: null, + email: null, + country: null, + include_player_ids: null, + include_external_user_ids: null, + include_email_tokens: null, + include_phone_numbers: null, + include_ios_tokens: null, + include_wp_wns_uris: null, + include_amazon_reg_ids: null, + include_chrome_reg_ids: null, + include_chrome_web_reg_ids: null, + include_android_reg_ids: null, + id: null, + value: null, + aggregation: null, + is_ios: null, + is_android: null, + is_huawei: null, + is_any_web: null, + is_chrome_web: null, + is_firefox: null, + is_safari: null, + is_wp_wns: null, + is_adm: null, + is_chrome: null, + channel_for_external_user_ids: null, + app_id: null, + external_id: null, + contents: null, + headings: null, + subtitle: null, + data: null, + huawei_msg_type: null, + url: null, + web_url: null, + app_url: null, + ios_attachments: null, + template_id: null, + content_available: null, + mutable_content: null, + target_content_identifier: null, + big_picture: null, + huawei_big_picture: null, + adm_big_picture: null, + chrome_big_picture: null, + chrome_web_image: null, + buttons: null, + web_buttons: null, + ios_category: null, + android_channel_id: null, + huawei_channel_id: null, + existing_android_channel_id: null, + huawei_existing_channel_id: null, + android_background_layout: null, + small_icon: null, + huawei_small_icon: null, + large_icon: null, + huawei_large_icon: null, + adm_small_icon: null, + adm_large_icon: null, + chrome_web_icon: null, + chrome_web_badge: null, + firefox_icon: null, + chrome_icon: null, + ios_sound: null, + android_sound: null, + huawei_sound: null, + adm_sound: null, + wp_wns_sound: null, + android_led_color: null, + huawei_led_color: null, + android_accent_color: null, + huawei_accent_color: null, + android_visibility: null, + huawei_visibility: null, + ios_badge_type: null, + ios_badge_count: null, + collapse_id: null, + web_push_topic: null, + apns_alert: null, + send_after: null, + delayed_option: null, + delivery_time_of_day: null, + ttl: null, + priority: null, + apns_push_type_override: null, + throttle_rate_per_minute: null, + android_group: null, + android_group_message: null, + adm_group: null, + adm_group_message: null, + thread_id: null, + summary_arg: null, + summary_arg_count: null, + email_subject: null, + email_body: null, + email_from_name: null, + email_from_address: null, + sms_from: null, + sms_media_urls: null, + successful: null, + failed: null, + errored: null, + converted: null, + received: null, + outcomes: null, + remaining: null, + queued_at: null, + completed_at: null, + platform_delivery_stats: null +) +``` + diff --git a/docs/NotificationWithMetaAllOf.md b/docs/NotificationWithMetaAllOf.md new file mode 100644 index 0000000..6755f89 --- /dev/null +++ b/docs/NotificationWithMetaAllOf.md @@ -0,0 +1,38 @@ +# OneSignal::NotificationWithMetaAllOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **remaining** | **Integer** | Number of notifications that have not been sent out yet. This can mean either our system is still processing the notification or you have delayed options set. | [optional] | +| **successful** | **Integer** | Number of notifications that were successfully delivered. | [optional] | +| **failed** | **Integer** | Number of notifications that could not be delivered due to those devices being unsubscribed. | [optional] | +| **errored** | **Integer** | Number of notifications that could not be delivered due to an error. You can find more information by viewing the notification in the dashboard. | [optional] | +| **converted** | **Integer** | Number of users who have clicked / tapped on your notification. | [optional] | +| **queued_at** | **Integer** | Unix timestamp indicating when the notification was created. | [optional] | +| **send_after** | **Integer** | Unix timestamp indicating when notification delivery should begin. | [optional] | +| **completed_at** | **Integer** | Unix timestamp indicating when notification delivery completed. The delivery duration from start to finish can be calculated with completed_at - send_after. | [optional] | +| **platform_delivery_stats** | [**PlatformDeliveryData**](PlatformDeliveryData.md) | | [optional] | +| **received** | **Integer** | Confirmed Deliveries number of devices that received the push notification. Paid Feature Only. Free accounts will see 0. | [optional] | +| **throttle_rate_per_minute** | **Integer** | number of push notifications sent per minute. Paid Feature Only. If throttling is not enabled for the app or the notification, and for free accounts, null is returned. Refer to Throttling for more details. | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::NotificationWithMetaAllOf.new( + remaining: null, + successful: null, + failed: null, + errored: null, + converted: null, + queued_at: null, + send_after: null, + completed_at: null, + platform_delivery_stats: null, + received: null, + throttle_rate_per_minute: null +) +``` + diff --git a/docs/OutcomesData.md b/docs/OutcomesData.md new file mode 100644 index 0000000..d8b76d2 --- /dev/null +++ b/docs/OutcomesData.md @@ -0,0 +1,18 @@ +# OneSignal::OutcomesData + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **outcomes** | [**Array<OutcomeData>**](OutcomeData.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::OutcomesData.new( + outcomes: null +) +``` + diff --git a/docs/Player.md b/docs/Player.md index ce31d19..2b8ab77 100644 --- a/docs/Player.md +++ b/docs/Player.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **id** | **String** | The device's OneSignal ID | [readonly] | | **invalid_identifier** | **Boolean** | If true, this is the equivalent of a user being Unsubscribed | [optional][readonly] | -| **app_id** | **String** | | | +| **app_id** | **String** | | [optional] | | **device_type** | **Integer** | Required The device's platform: 0 = iOS 1 = Android 2 = Amazon 3 = WindowsPhone (MPNS) 4 = Chrome Apps / Extensions 5 = Chrome Web Push 6 = Windows (WNS) 7 = Safari 8 = Firefox 9 = MacOS 10 = Alexa 11 = Email 13 = For Huawei App Gallery Builds SDK Setup. Not for Huawei Devices using FCM 14 = SMS | | | **external_user_id** | **String** | a custom user ID | [optional] | | **external_user_id_auth_hash** | **String** | Only required if you have enabled Identity Verification and device_type is NOT 11 email. | [optional] | @@ -21,7 +21,7 @@ | **sdk** | **String** | Name and version of the sdk/plugin that's calling this API method (if any) | [optional] | | **session_count** | **Integer** | Number of times the user has played the game, defaults to 1 | [optional] | | **tags** | **Object** | Custom tags for the player. Only support string and integer key value pairs. Does not support arrays or other nested objects. Setting a tag value to null or an empty string will remove the tag. Example: {\"foo\":\"bar\",\"this\":\"that\"} Limitations: - 100 tags per call - Android SDK users: tags cannot be removed or changed via API if set through SDK sendTag methods. Recommended to only tag devices with 1 kilobyte of data Please consider using your own Database to save more than 1 kilobyte of data. See: Internal Database & CRM | [optional] | -| **amount_spent** | **String** | Amount the user has spent in USD, up to two decimal places | [optional] | +| **amount_spent** | **Float** | Amount the user has spent in USD, up to two decimal places | [optional] | | **created_at** | **Integer** | Unixtime when the player joined the game | [optional] | | **playtime** | **Integer** | Seconds player was running your app. | [optional] | | **badge_count** | **Integer** | Current iOS badge count displayed on the app icon NOTE: Not supported for apps created after June 2018, since badge count for apps created after this date are handled on the client. | [optional] | diff --git a/docs/PlayerNotificationTarget.md b/docs/PlayerNotificationTarget.md index 2fb9e9e..ba00dfe 100644 --- a/docs/PlayerNotificationTarget.md +++ b/docs/PlayerNotificationTarget.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **include_player_ids** | **Array<String>** | Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call | [optional] | -| **include_external_user_ids** | **Array<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [“custom-id-assigned-by-api”] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | +| **include_external_user_ids** | **Array<String>** | Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. | [optional] | | **include_email_tokens** | **Array<String>** | Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call | [optional] | | **include_phone_numbers** | **Array<String>** | Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call | [optional] | | **include_ios_tokens** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call | [optional] | diff --git a/docs/StringMap.md b/docs/StringMap.md index 819a653..dac6e3e 100644 --- a/docs/StringMap.md +++ b/docs/StringMap.md @@ -4,7 +4,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **en** | **String** | Text in English. Will be used as a fallback | | +| **en** | **String** | Text in English. Will be used as a fallback | [optional] | | **ar** | **String** | Text in Arabic. | [optional] | | **bs** | **String** | Text in Bosnian. | [optional] | | **bg** | **String** | Text in Bulgarian. | [optional] | diff --git a/git_push.sh b/git_push.sh deleted file mode 100644 index ced3be2..0000000 --- a/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/lib/onesignal.rb b/lib/onesignal.rb index 6f5963a..0f5e7c7 100644 --- a/lib/onesignal.rb +++ b/lib/onesignal.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -28,21 +28,26 @@ require 'onesignal/models/inline_response200' require 'onesignal/models/inline_response2001' require 'onesignal/models/inline_response2002' -require 'onesignal/models/inline_response2003' -require 'onesignal/models/inline_response2004' require 'onesignal/models/inline_response2005' +require 'onesignal/models/inline_response2007' +require 'onesignal/models/inline_response2008' require 'onesignal/models/inline_response201' require 'onesignal/models/inline_response400' require 'onesignal/models/inline_response4001' require 'onesignal/models/inline_response4002' -require 'onesignal/models/inline_response409' +require 'onesignal/models/inline_response4003' +require 'onesignal/models/invalid_identifier_error' require 'onesignal/models/notification' +require 'onesignal/models/notification200_errors' require 'onesignal/models/notification_all_of' require 'onesignal/models/notification_all_of_android_background_layout' require 'onesignal/models/notification_slice' require 'onesignal/models/notification_target' +require 'onesignal/models/notification_with_meta' +require 'onesignal/models/notification_with_meta_all_of' require 'onesignal/models/operator' require 'onesignal/models/outcome_data' +require 'onesignal/models/outcomes_data' require 'onesignal/models/platform_delivery_data' require 'onesignal/models/player' require 'onesignal/models/player_notification_target' diff --git a/lib/onesignal/api/default_api.rb b/lib/onesignal/api/default_api.rb index 72e1bbe..3081840 100644 --- a/lib/onesignal/api/default_api.rb +++ b/lib/onesignal/api/default_api.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -123,7 +123,10 @@ def create_app_with_http_info(app, opts = {}) # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} @@ -188,7 +191,10 @@ def create_notification_with_http_info(notification, opts = {}) # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} @@ -220,20 +226,20 @@ def create_notification_with_http_info(notification, opts = {}) end # Add a device - # Register a new device to one of your OneSignal apps 🚧 Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. 🚧 iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. + # Register a new device to one of your OneSignal apps 🚧 Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. 🚧 iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. # @param player [Player] # @param [Hash] opts the optional parameters - # @return [InlineResponse2004] + # @return [InlineResponse2005] def create_player(player, opts = {}) data, _status_code, _headers = create_player_with_http_info(player, opts) data end # Add a device - # Register a new device to one of your OneSignal apps 🚧 Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. 🚧 iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. + # Register a new device to one of your OneSignal apps &#x1F6A7; Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds. # @param player [Player] # @param [Hash] opts the optional parameters - # @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers + # @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 data, response status code and response headers def create_player_with_http_info(player, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.create_player ...' @@ -253,7 +259,10 @@ def create_player_with_http_info(player, opts = {}) # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} @@ -262,7 +271,7 @@ def create_player_with_http_info(player, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(player) # return_type - return_type = opts[:debug_return_type] || 'InlineResponse2004' + return_type = opts[:debug_return_type] || 'InlineResponse2005' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] @@ -285,7 +294,7 @@ def create_player_with_http_info(player, opts = {}) end # Create Segments - # Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. + # Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. # @param [Hash] opts the optional parameters # @option opts [Segment] :segment @@ -296,7 +305,7 @@ def create_segments(app_id, opts = {}) end # Create Segments - # Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. + # Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit. # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. # @param [Hash] opts the optional parameters # @option opts [Segment] :segment @@ -320,7 +329,10 @@ def create_segments_with_http_info(app_id, opts = {}) # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} @@ -356,7 +368,7 @@ def create_segments_with_http_info(app_id, opts = {}) # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. # @param player_id [String] The OneSignal player_id # @param [Hash] opts the optional parameters - # @return [InlineResponse2001] + # @return [InlineResponse2007] def delete_player(app_id, player_id, opts = {}) data, _status_code, _headers = delete_player_with_http_info(app_id, player_id, opts) data @@ -367,7 +379,7 @@ def delete_player(app_id, player_id, opts = {}) # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. # @param player_id [String] The OneSignal player_id # @param [Hash] opts the optional parameters - # @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers + # @return [Array<(InlineResponse2007, Integer, Hash)>] InlineResponse2007 data, response status code and response headers def delete_player_with_http_info(app_id, player_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.delete_player ...' @@ -399,7 +411,7 @@ def delete_player_with_http_info(app_id, player_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'InlineResponse2001' + return_type = opts[:debug_return_type] || 'InlineResponse2007' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] @@ -426,7 +438,7 @@ def delete_player_with_http_info(app_id, player_id, opts = {}) # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard. # @param [Hash] opts the optional parameters - # @return [InlineResponse2003] + # @return [InlineResponse2001] def delete_segments(app_id, segment_id, opts = {}) data, _status_code, _headers = delete_segments_with_http_info(app_id, segment_id, opts) data @@ -437,7 +449,7 @@ def delete_segments(app_id, segment_id, opts = {}) # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard. # @param [Hash] opts the optional parameters - # @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers + # @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers def delete_segments_with_http_info(app_id, segment_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.delete_segments ...' @@ -468,7 +480,7 @@ def delete_segments_with_http_info(app_id, segment_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'InlineResponse2003' + return_type = opts[:debug_return_type] || 'InlineResponse2001' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] @@ -491,22 +503,22 @@ def delete_segments_with_http_info(app_id, segment_id, opts = {}) end # CSV export - # Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + # Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | # @param app_id [String] The app ID that you want to export devices from # @param [Hash] opts the optional parameters # @option opts [ExportPlayersRequestBody] :export_players_request_body - # @return [InlineResponse2005] + # @return [InlineResponse2008] def export_players(app_id, opts = {}) data, _status_code, _headers = export_players_with_http_info(app_id, opts) data end # CSV export - # Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + # Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | # @param app_id [String] The app ID that you want to export devices from # @param [Hash] opts the optional parameters # @option opts [ExportPlayersRequestBody] :export_players_request_body - # @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 data, response status code and response headers + # @return [Array<(InlineResponse2008, Integer, Hash)>] InlineResponse2008 data, response status code and response headers def export_players_with_http_info(app_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.export_players ...' @@ -526,7 +538,10 @@ def export_players_with_http_info(app_id, opts = {}) # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} @@ -535,7 +550,7 @@ def export_players_with_http_info(app_id, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'export_players_request_body']) # return_type - return_type = opts[:debug_return_type] || 'InlineResponse2005' + return_type = opts[:debug_return_type] || 'InlineResponse2008' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] @@ -623,7 +638,7 @@ def get_app_with_http_info(app_id, opts = {}) # View apps # View the details of all of your current OneSignal apps # @param [Hash] opts the optional parameters - # @return [String] + # @return [Array] def get_apps(opts = {}) data, _status_code, _headers = get_apps_with_http_info(opts) data @@ -632,7 +647,7 @@ def get_apps(opts = {}) # View apps # View the details of all of your current OneSignal apps # @param [Hash] opts the optional parameters - # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def get_apps_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.get_apps ...' @@ -655,7 +670,7 @@ def get_apps_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'String' + return_type = opts[:debug_return_type] || 'Array' # auth_names auth_names = opts[:debug_auth_names] || ['user_key'] @@ -682,7 +697,7 @@ def get_apps_with_http_info(opts = {}) # @param app_id [String] # @param notification_id [String] # @param [Hash] opts the optional parameters - # @return [Notification] + # @return [NotificationWithMeta] def get_notification(app_id, notification_id, opts = {}) data, _status_code, _headers = get_notification_with_http_info(app_id, notification_id, opts) data @@ -693,7 +708,7 @@ def get_notification(app_id, notification_id, opts = {}) # @param app_id [String] # @param notification_id [String] # @param [Hash] opts the optional parameters - # @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers + # @return [Array<(NotificationWithMeta, Integer, Hash)>] NotificationWithMeta data, response status code and response headers def get_notification_with_http_info(app_id, notification_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.get_notification ...' @@ -725,7 +740,7 @@ def get_notification_with_http_info(app_id, notification_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'Notification' + return_type = opts[:debug_return_type] || 'NotificationWithMeta' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] @@ -748,7 +763,7 @@ def get_notification_with_http_info(app_id, notification_id, opts = {}) end # Notification History - # -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. + # -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. # @param notification_id [String] The \"id\" of the message found in the Notification object # @param get_notification_request_body [GetNotificationRequestBody] # @param [Hash] opts the optional parameters @@ -759,7 +774,7 @@ def get_notification_history(notification_id, get_notification_request_body, opt end # Notification History - # -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. + # -> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. &#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. # @param notification_id [String] The \"id\" of the message found in the Notification object # @param get_notification_request_body [GetNotificationRequestBody] # @param [Hash] opts the optional parameters @@ -787,7 +802,10 @@ def get_notification_history_with_http_info(notification_id, get_notification_re # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} @@ -822,7 +840,7 @@ def get_notification_history_with_http_info(notification_id, get_notification_re # View the details of multiple notifications # @param app_id [String] The app ID that you want to view notifications from # @param [Hash] opts the optional parameters - # @option opts [String] :limit How many notifications to return. Max is 50. Default is 50. + # @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 # @return [NotificationSlice] @@ -835,7 +853,7 @@ def get_notifications(app_id, opts = {}) # View the details of multiple notifications # @param app_id [String] The app ID that you want to view notifications from # @param [Hash] opts the optional parameters - # @option opts [String] :limit How many notifications to return. Max is 50. Default is 50. + # @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 # @return [Array<(NotificationSlice, Integer, Hash)>] NotificationSlice data, response status code and response headers @@ -896,30 +914,30 @@ def get_notifications_with_http_info(app_id, opts = {}) end # View Outcomes - # View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + # View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param outcome_names [String] Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the “os” prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum + # @param outcome_names [String] Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum # @param [Hash] opts the optional parameters - # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where “Sales, Purchase” is the custom outcomes with a comma in the name. + # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. # @option opts [String] :outcome_time_range Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. # @option opts [String] :outcome_platforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. # @option opts [String] :outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. - # @return [Array] + # @return [OutcomesData] def get_outcomes(app_id, outcome_names, opts = {}) data, _status_code, _headers = get_outcomes_with_http_info(app_id, outcome_names, opts) data end # View Outcomes - # View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + # View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param outcome_names [String] Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the “os” prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum + # @param outcome_names [String] Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum # @param [Hash] opts the optional parameters - # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where “Sales, Purchase” is the custom outcomes with a comma in the name. + # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. # @option opts [String] :outcome_time_range Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. # @option opts [String] :outcome_platforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. # @option opts [String] :outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. - # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + # @return [Array<(OutcomesData, Integer, Hash)>] OutcomesData data, response status code and response headers def get_outcomes_with_http_info(app_id, outcome_names, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.get_outcomes ...' @@ -955,7 +973,7 @@ def get_outcomes_with_http_info(app_id, outcome_names, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'Array' + return_type = opts[:debug_return_type] || 'OutcomesData' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] @@ -1054,7 +1072,7 @@ def get_player_with_http_info(app_id, player_id, opts = {}) # View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. # @param app_id [String] The app ID that you want to view players from # @param [Hash] opts the optional parameters - # @option opts [String] :limit How many devices to return. Max is 300. Default is 300 + # @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300 # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id; # @return [PlayerSlice] def get_players(app_id, opts = {}) @@ -1066,7 +1084,7 @@ def get_players(app_id, opts = {}) # View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. # @param app_id [String] The app ID that you want to view players from # @param [Hash] opts the optional parameters - # @option opts [String] :limit How many devices to return. Max is 300. Default is 300 + # @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300 # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id; # @return [Array<(PlayerSlice, Integer, Hash)>] PlayerSlice data, response status code and response headers def get_players_with_http_info(app_id, opts = {}) @@ -1160,7 +1178,10 @@ def update_app_with_http_info(app_id, app, opts = {}) # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} @@ -1231,7 +1252,10 @@ def update_player_with_http_info(player_id, player, opts = {}) # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} @@ -1263,24 +1287,24 @@ def update_player_with_http_info(player_id, player, opts = {}) end # Edit tags with external user id - # Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. 📘 Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } + # Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. 📘 Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } # @param app_id [String] The OneSignal App ID the user record is found under. # @param external_user_id [String] The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. # @param [Hash] opts the optional parameters # @option opts [UpdatePlayerTagsRequestBody] :update_player_tags_request_body - # @return [InlineResponse2003] + # @return [InlineResponse2001] def update_player_tags(app_id, external_user_id, opts = {}) data, _status_code, _headers = update_player_tags_with_http_info(app_id, external_user_id, opts) data end # Edit tags with external user id - # Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. 📘 Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } + # Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. &#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" } # @param app_id [String] The OneSignal App ID the user record is found under. # @param external_user_id [String] The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated. # @param [Hash] opts the optional parameters # @option opts [UpdatePlayerTagsRequestBody] :update_player_tags_request_body - # @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers + # @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers def update_player_tags_with_http_info(app_id, external_user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DefaultApi.update_player_tags ...' @@ -1304,7 +1328,10 @@ def update_player_tags_with_http_info(app_id, external_user_id, opts = {}) # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} @@ -1313,7 +1340,7 @@ def update_player_tags_with_http_info(app_id, external_user_id, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_player_tags_request_body']) # return_type - return_type = opts[:debug_return_type] || 'InlineResponse2003' + return_type = opts[:debug_return_type] || 'InlineResponse2001' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] diff --git a/lib/onesignal/api_client.rb b/lib/onesignal/api_client.rb index 17eb9f3..958e506 100644 --- a/lib/onesignal/api_client.rb +++ b/lib/onesignal/api_client.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -90,10 +90,11 @@ 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, name=onesignal-ruby, version=1.0.1' header_params = @default_headers.merge(opts[:header_params] || {}) - header_params['OS-Usage-Data'] = 'kind=sdk, name=onesignal-ruby, version=1.0.0.beta1' query_params = opts[:query_params] || {} form_params = opts[:form_params] || {} + follow_location = opts[:follow_location] || true update_params_for_auth! header_params, query_params, opts[:auth_names] @@ -110,7 +111,8 @@ def build_request(http_method, path, opts = {}) :ssl_verifyhost => _verify_ssl_host, :sslcert => @config.cert_file, :sslkey => @config.key_file, - :verbose => @config.debugging + :verbose => @config.debugging, + :followlocation => follow_location } # set custom cert, if provided @@ -297,7 +299,7 @@ def build_request_url(path, opts = {}) @config.base_url(opts[:operation]) + path end - # Update hearder and query params based on authentication settings. + # Update header and query params based on authentication settings. # # @param [Hash] header_params Header parameters # @param [Hash] query_params Query parameters @@ -336,8 +338,8 @@ def select_header_accept(accepts) # @param [Array] content_types array for Content-Type # @return [String] the Content-Type header (e.g. application/json) def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? + # return nil by default + return if content_types.nil? || content_types.empty? # use JSON when present, otherwise use the first one json_content_type = content_types.find { |s| json_mime?(s) } json_content_type || content_types.first diff --git a/lib/onesignal/api_error.rb b/lib/onesignal/api_error.rb index 1f2fdda..a246cd6 100644 --- a/lib/onesignal/api_error.rb +++ b/lib/onesignal/api_error.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end diff --git a/lib/onesignal/app_id_missing_error.rb b/lib/onesignal/app_id_missing_error.rb deleted file mode 100644 index 029ddbb..0000000 --- a/lib/onesignal/app_id_missing_error.rb +++ /dev/null @@ -1,7 +0,0 @@ -module OneSignal - class AppIdMissingError < StandardError - def initialize(message = 'An app ID is needed for this resource') - super(message) - end - end -end diff --git a/lib/onesignal/client.rb b/lib/onesignal/client.rb deleted file mode 100644 index b514bb1..0000000 --- a/lib/onesignal/client.rb +++ /dev/null @@ -1,44 +0,0 @@ -module OneSignal - class Client - BASE_URL = 'https://onesignal.com/api/v1'.freeze - - attr_reader :auth_token, :app_id - - def initialize(auth_token: nil, app_id: nil) - @auth_token = auth_token - @app_id = app_id - - ensure_auth_token_presence - end - - def apps - @apps ||= AppResource.new(self) - end - - def players - ensure_app_id_presence - - @players ||= PlayerResource.new(self) - end - - def notifications - ensure_app_id_presence - - @notifications ||= NotificationResource.new(self) - end - - private - - def ensure_auth_token_presence - if auth_token.nil? - raise ArgumentError, 'missing keyword: auth_token' - end - end - - def ensure_app_id_presence - if app_id.nil? - raise AppIdMissingError - end - end - end -end diff --git a/lib/onesignal/configuration.rb b/lib/onesignal/configuration.rb index 882e1dc..1cb7a7a 100644 --- a/lib/onesignal/configuration.rb +++ b/lib/onesignal/configuration.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -110,6 +110,7 @@ class Configuration # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 attr_accessor :params_encoding + attr_accessor :inject_format attr_accessor :force_ending_format @@ -126,9 +127,10 @@ def initialize @client_side_validation = true @verify_ssl = true @verify_ssl_host = true - @params_encoding = nil @cert_file = nil @key_file = nil + @timeout = 0 + @params_encoding = nil @debugging = false @inject_format = false @force_ending_format = false @@ -238,5 +240,6 @@ def server_url(index, variables = {}, servers = nil) url end + end end diff --git a/lib/onesignal/models/app.rb b/lib/onesignal/models/app.rb index 8015686..1b45283 100644 --- a/lib/onesignal/models/app.rb +++ b/lib/onesignal/models/app.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -424,6 +424,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/base_model.rb b/lib/onesignal/models/base_model.rb deleted file mode 100644 index 79df225..0000000 --- a/lib/onesignal/models/base_model.rb +++ /dev/null @@ -1,40 +0,0 @@ -module OneSignal - class BaseModel - def self.to_proc - method(:new).to_proc - end - - def initialize(attributes = {}) - attributes.each do |key, value| - create_attr(key) - send("#{key}=", value) - end - end - - def inspect - values = Hash[ - instance_variables.map { |name| [name, instance_variable_get(name)] } - ] - - "<#{self.class.name} #{values}>" - end - - private - - def create_attr(name) - create_method("#{name}=".to_sym) do |value| - instance_variable_set("@#{name}", value) - end - - create_method(name.to_sym) do - instance_variable_get("@#{name}") - end - end - - def create_method(name, &block) - unless respond_to?(name) - self.class.send(:define_method, name, &block) - end - end - end -end diff --git a/lib/onesignal/models/button.rb b/lib/onesignal/models/button.rb index be792b4..9ec94eb 100644 --- a/lib/onesignal/models/button.rb +++ b/lib/onesignal/models/button.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -130,6 +130,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/delivery_data.rb b/lib/onesignal/models/delivery_data.rb index 130d94a..c4555e0 100644 --- a/lib/onesignal/models/delivery_data.rb +++ b/lib/onesignal/models/delivery_data.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -55,6 +55,11 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'successful', + :'failed', + :'errored', + :'converted', + :'received' ]) end @@ -143,6 +148,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/export_players_request_body.rb b/lib/onesignal/models/export_players_request_body.rb index 03e7233..970f959 100644 --- a/lib/onesignal/models/export_players_request_body.rb +++ b/lib/onesignal/models/export_players_request_body.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -130,6 +130,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/filter.rb b/lib/onesignal/models/filter.rb index e6ea0b3..7220310 100644 --- a/lib/onesignal/models/filter.rb +++ b/lib/onesignal/models/filter.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -182,6 +182,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/filter_expressions.rb b/lib/onesignal/models/filter_expressions.rb index 8afd3a6..f656c06 100644 --- a/lib/onesignal/models/filter_expressions.rb +++ b/lib/onesignal/models/filter_expressions.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -224,6 +224,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/filter_notification_target.rb b/lib/onesignal/models/filter_notification_target.rb index c62110b..a43a070 100644 --- a/lib/onesignal/models/filter_notification_target.rb +++ b/lib/onesignal/models/filter_notification_target.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -218,6 +218,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/get_notification_request_body.rb b/lib/onesignal/models/get_notification_request_body.rb index 610acea..6e6e5be 100644 --- a/lib/onesignal/models/get_notification_request_body.rb +++ b/lib/onesignal/models/get_notification_request_body.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -161,6 +161,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/inline_response200.rb b/lib/onesignal/models/inline_response200.rb index 802a553..09e2509 100644 --- a/lib/onesignal/models/inline_response200.rb +++ b/lib/onesignal/models/inline_response200.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -45,7 +45,7 @@ def self.openapi_types :'id' => :'String', :'recipients' => :'Integer', :'external_id' => :'String', - :'errors' => :'OneOfobjectarray' + :'errors' => :'Notification200Errors' } end @@ -145,6 +145,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/inline_response2001.rb b/lib/onesignal/models/inline_response2001.rb index 04470be..08c912d 100644 --- a/lib/onesignal/models/inline_response2001.rb +++ b/lib/onesignal/models/inline_response2001.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -32,7 +32,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'success' => :'String' + :'success' => :'Boolean' } end @@ -107,6 +107,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/inline_response2002.rb b/lib/onesignal/models/inline_response2002.rb index 7f6947f..05bf080 100644 --- a/lib/onesignal/models/inline_response2002.rb +++ b/lib/onesignal/models/inline_response2002.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -35,7 +35,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'success' => :'String', + :'success' => :'Boolean', :'destination_url' => :'String' } end @@ -116,6 +116,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/inline_response2005.rb b/lib/onesignal/models/inline_response2005.rb index 0199fd9..2b86f83 100644 --- a/lib/onesignal/models/inline_response2005.rb +++ b/lib/onesignal/models/inline_response2005.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -15,12 +15,15 @@ module OneSignal class InlineResponse2005 - attr_accessor :csv_file_url + attr_accessor :success + + attr_accessor :id # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'csv_file_url' => :'csv_file_url' + :'success' => :'success', + :'id' => :'id' } end @@ -32,7 +35,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'csv_file_url' => :'String' + :'success' => :'Boolean', + :'id' => :'String' } end @@ -57,8 +61,12 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'csv_file_url') - self.csv_file_url = attributes[:'csv_file_url'] + if attributes.key?(:'success') + self.success = attributes[:'success'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] end end @@ -80,7 +88,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - csv_file_url == o.csv_file_url + success == o.success && + id == o.id end # @see the `==` method @@ -92,7 +101,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [csv_file_url].hash + [success, id].hash end # Builds the object from hash @@ -107,6 +116,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/inline_response2003.rb b/lib/onesignal/models/inline_response2007.rb similarity index 95% rename from lib/onesignal/models/inline_response2003.rb rename to lib/onesignal/models/inline_response2007.rb index 09bd219..f998d41 100644 --- a/lib/onesignal/models/inline_response2003.rb +++ b/lib/onesignal/models/inline_response2007.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -14,7 +14,7 @@ require 'time' module OneSignal - class InlineResponse2003 + class InlineResponse2007 attr_accessor :success # Attribute mapping from ruby-style variable name to JSON key. @@ -32,7 +32,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean' + :'success' => :'String' } end @@ -46,13 +46,13 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InlineResponse2003` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InlineResponse2007` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InlineResponse2003`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InlineResponse2007`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } @@ -107,6 +107,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/inline_response2004.rb b/lib/onesignal/models/inline_response2008.rb similarity index 90% rename from lib/onesignal/models/inline_response2004.rb rename to lib/onesignal/models/inline_response2008.rb index 02a12ed..7e6ed3a 100644 --- a/lib/onesignal/models/inline_response2004.rb +++ b/lib/onesignal/models/inline_response2008.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -14,16 +14,13 @@ require 'time' module OneSignal - class InlineResponse2004 - attr_accessor :success - - attr_accessor :id + class InlineResponse2008 + attr_accessor :csv_file_url # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success', - :'id' => :'id' + :'csv_file_url' => :'csv_file_url' } end @@ -35,8 +32,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean', - :'id' => :'String' + :'csv_file_url' => :'String' } end @@ -50,23 +46,19 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InlineResponse2004` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InlineResponse2008` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InlineResponse2004`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InlineResponse2008`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'success') - self.success = attributes[:'success'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] + if attributes.key?(:'csv_file_url') + self.csv_file_url = attributes[:'csv_file_url'] end end @@ -88,8 +80,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - success == o.success && - id == o.id + csv_file_url == o.csv_file_url end # @see the `==` method @@ -101,7 +92,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [success, id].hash + [csv_file_url].hash end # Builds the object from hash @@ -116,6 +107,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/inline_response201.rb b/lib/onesignal/models/inline_response201.rb index eef0e6e..d3e4298 100644 --- a/lib/onesignal/models/inline_response201.rb +++ b/lib/onesignal/models/inline_response201.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -117,6 +117,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/inline_response400.rb b/lib/onesignal/models/inline_response400.rb index ed0f76c..882c1d4 100644 --- a/lib/onesignal/models/inline_response400.rb +++ b/lib/onesignal/models/inline_response400.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -109,6 +109,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/inline_response4001.rb b/lib/onesignal/models/inline_response4001.rb index c919d7d..0d389c7 100644 --- a/lib/onesignal/models/inline_response4001.rb +++ b/lib/onesignal/models/inline_response4001.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -118,6 +118,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/inline_response4002.rb b/lib/onesignal/models/inline_response4002.rb index 0c0a713..e2a27cc 100644 --- a/lib/onesignal/models/inline_response4002.rb +++ b/lib/onesignal/models/inline_response4002.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -15,12 +15,15 @@ module OneSignal class InlineResponse4002 - attr_accessor :erorrs + attr_accessor :success + + attr_accessor :errors # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'erorrs' => :'erorrs' + :'success' => :'success', + :'errors' => :'errors' } end @@ -32,7 +35,8 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'erorrs' => :'Array' + :'success' => :'Boolean', + :'errors' => :'Array' } end @@ -57,9 +61,13 @@ def initialize(attributes = {}) h[k.to_sym] = v } - if attributes.key?(:'erorrs') - if (value = attributes[:'erorrs']).is_a?(Array) - self.erorrs = value + if attributes.key?(:'success') + self.success = attributes[:'success'] + end + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value end end end @@ -82,7 +90,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - erorrs == o.erorrs + success == o.success && + errors == o.errors end # @see the `==` method @@ -94,7 +103,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [erorrs].hash + [success, errors].hash end # Builds the object from hash @@ -109,6 +118,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/inline_response409.rb b/lib/onesignal/models/inline_response4003.rb similarity index 87% rename from lib/onesignal/models/inline_response409.rb rename to lib/onesignal/models/inline_response4003.rb index 1c59d45..76b3051 100644 --- a/lib/onesignal/models/inline_response409.rb +++ b/lib/onesignal/models/inline_response4003.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -14,16 +14,13 @@ require 'time' module OneSignal - class InlineResponse409 - attr_accessor :success - - attr_accessor :errors + class InlineResponse4003 + attr_accessor :erorrs # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'success' => :'success', - :'errors' => :'errors' + :'erorrs' => :'erorrs' } end @@ -35,8 +32,7 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'success' => :'Boolean', - :'errors' => :'Array' + :'erorrs' => :'Array' } end @@ -50,24 +46,20 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InlineResponse409` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InlineResponse4003` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InlineResponse409`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InlineResponse4003`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'success') - self.success = attributes[:'success'] - end - - if attributes.key?(:'errors') - if (value = attributes[:'errors']).is_a?(Array) - self.errors = value + if attributes.key?(:'erorrs') + if (value = attributes[:'erorrs']).is_a?(Array) + self.erorrs = value end end end @@ -90,8 +82,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - success == o.success && - errors == o.errors + erorrs == o.erorrs end # @see the `==` method @@ -103,7 +94,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [success, errors].hash + [erorrs].hash end # Builds the object from hash @@ -118,6 +109,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/invalid_identifier_error.rb b/lib/onesignal/models/invalid_identifier_error.rb new file mode 100644 index 0000000..04dcc1f --- /dev/null +++ b/lib/onesignal/models/invalid_identifier_error.rb @@ -0,0 +1,234 @@ +=begin +#OneSignal + +#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: 1.0.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class InvalidIdentifierError + # Returned if using include_external_user_ids + attr_accessor :invalid_external_user_ids + + # Returned if using include_player_ids and some were valid and others were not. + attr_accessor :invalid_player_ids + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'invalid_external_user_ids' => :'invalid_external_user_ids', + :'invalid_player_ids' => :'invalid_player_ids' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'invalid_external_user_ids' => :'Array', + :'invalid_player_ids' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InvalidIdentifierError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InvalidIdentifierError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'invalid_external_user_ids') + if (value = attributes[:'invalid_external_user_ids']).is_a?(Array) + self.invalid_external_user_ids = value + end + end + + if attributes.key?(:'invalid_player_ids') + if (value = attributes[:'invalid_player_ids']).is_a?(Array) + self.invalid_player_ids = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + invalid_external_user_ids == o.invalid_external_user_ids && + invalid_player_ids == o.invalid_player_ids + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [invalid_external_user_ids, invalid_player_ids].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/notification.rb b/lib/onesignal/models/notification.rb index 727a26a..c73564f 100644 --- a/lib/onesignal/models/notification.rb +++ b/lib/onesignal/models/notification.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -60,7 +60,7 @@ class Notification # Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call attr_accessor :include_player_ids - # Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [“custom-id-assigned-by-api”] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. + # Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. attr_accessor :include_external_user_ids # Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call @@ -239,34 +239,34 @@ class Notification # Channel: Push Notifications Platform: iOS Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable vibration and sound for the notification. Example: \"notification.wav\" attr_accessor :ios_sound - # Channel: Push Notifications Platform: Android ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" + # Channel: Push Notifications Platform: Android ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" attr_accessor :android_sound - # Channel: Push Notifications Platform: Huawei ⚠Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: \"/res/raw/notification\" + # Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: \"/res/raw/notification\" attr_accessor :huawei_sound - # Channel: Push Notifications Platform: Amazon ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" + # Channel: Push Notifications Platform: Amazon ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" attr_accessor :adm_sound # Channel: Push Notifications Platform: Windows Sound file that is included in your app to play instead of the default device notification sound. Example: \"notification.wav\" attr_accessor :wp_wns_sound - # Channel: Push Notifications Platform: Android ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): \"FF0000FF\" + # Channel: Push Notifications Platform: Android ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): \"FF0000FF\" attr_accessor :android_led_color - # Channel: Push Notifications Platform: Huawei ⚠Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): \"0000FF\" + # Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): \"0000FF\" attr_accessor :huawei_led_color # Channel: Push Notifications Platform: Android Sets the background color of the notification circle to the left of the notification text. Only applies to apps targeting Android API level 21+ on Android 5.0+ devices. Example(Red): \"FFFF0000\" attr_accessor :android_accent_color - # Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device’s theme color if not set. + # Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device's theme color if not set. attr_accessor :huawei_accent_color - # Channel: Push Notifications Platform: Android 5.0_ ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) + # Channel: Push Notifications Platform: Android 5.0_ ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) attr_accessor :android_visibility - # Channel: Push Notifications Platform: Huawei ⚠Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) + # Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) attr_accessor :huawei_visibility # Channel: Push Notifications Platform: iOS Describes whether to set or increase/decrease your app's iOS badge count by the ios_badgeCount specified count. Can specify None, SetTo, or Increase. `None` leaves the count unaffected. `SetTo` directly sets the badge count to the number specified in ios_badgeCount. `Increase` adds the number specified in ios_badgeCount to the total. Use a negative number to decrease the badge count. @@ -327,7 +327,7 @@ class Notification attr_accessor :summary_arg_count # Channel: Email Required. The subject of the email. - attr_accessor :email_subect + attr_accessor :email_subject # Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. attr_accessor :email_body @@ -475,7 +475,7 @@ def self.attribute_map :'thread_id' => :'thread_id', :'summary_arg' => :'summary_arg', :'summary_arg_count' => :'summary_arg_count', - :'email_subect' => :'email_subect', + :'email_subject' => :'email_subject', :'email_body' => :'email_body', :'email_from_name' => :'email_from_name', :'email_from_address' => :'email_from_address', @@ -584,7 +584,7 @@ def self.openapi_types :'collapse_id' => :'String', :'web_push_topic' => :'String', :'apns_alert' => :'Object', - :'send_after' => :'String', + :'send_after' => :'Time', :'delayed_option' => :'String', :'delivery_time_of_day' => :'String', :'ttl' => :'Integer', @@ -598,7 +598,7 @@ def self.openapi_types :'thread_id' => :'String', :'summary_arg' => :'String', :'summary_arg_count' => :'Integer', - :'email_subect' => :'String', + :'email_subject' => :'String', :'email_body' => :'String', :'email_from_name' => :'String', :'email_from_address' => :'String', @@ -610,6 +610,25 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'is_ios', + :'is_android', + :'is_huawei', + :'is_any_web', + :'is_chrome_web', + :'is_firefox', + :'is_safari', + :'is_wp_wns', + :'is_adm', + :'is_chrome', + :'contents', + :'headings', + :'subtitle', + :'content_available', + :'android_visibility', + :'huawei_visibility', + :'ios_badge_count', + :'ttl', + :'priority', ]) end @@ -1090,8 +1109,8 @@ def initialize(attributes = {}) self.summary_arg_count = attributes[:'summary_arg_count'] end - if attributes.key?(:'email_subect') - self.email_subect = attributes[:'email_subect'] + if attributes.key?(:'email_subject') + self.email_subject = attributes[:'email_subject'] end if attributes.key?(:'email_body') @@ -1258,7 +1277,7 @@ def ==(o) thread_id == o.thread_id && summary_arg == o.summary_arg && summary_arg_count == o.summary_arg_count && - email_subect == o.email_subect && + email_subject == o.email_subject && email_body == o.email_body && email_from_name == o.email_from_name && email_from_address == o.email_from_address && @@ -1275,7 +1294,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [included_segments, excluded_segments, last_session, first_session, session_count, session_time, amount_spent, bought_sku, tag, language, app_version, location, email, country, include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, id, value, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, channel_for_external_user_ids, app_id, external_id, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, send_after, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, email_subect, email_body, email_from_name, email_from_address, sms_from, sms_media_urls].hash + [included_segments, excluded_segments, last_session, first_session, session_count, session_time, amount_spent, bought_sku, tag, language, app_version, location, email, country, include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, id, value, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, channel_for_external_user_ids, app_id, external_id, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, send_after, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, email_subject, email_body, email_from_name, email_from_address, sms_from, sms_media_urls].hash end # Builds the object from hash @@ -1290,6 +1309,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/notification200_errors.rb b/lib/onesignal/models/notification200_errors.rb new file mode 100644 index 0000000..0fd1285 --- /dev/null +++ b/lib/onesignal/models/notification200_errors.rb @@ -0,0 +1,105 @@ +=begin +#OneSignal + +#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: 1.0.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + module Notification200Errors + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Array', + :'InvalidIdentifierError' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = OneSignal.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/onesignal/models/notification_all_of.rb b/lib/onesignal/models/notification_all_of.rb index fe27591..2f9de80 100644 --- a/lib/onesignal/models/notification_all_of.rb +++ b/lib/onesignal/models/notification_all_of.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -167,34 +167,34 @@ class NotificationAllOf # Channel: Push Notifications Platform: iOS Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable vibration and sound for the notification. Example: \"notification.wav\" attr_accessor :ios_sound - # Channel: Push Notifications Platform: Android ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" + # Channel: Push Notifications Platform: Android ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" attr_accessor :android_sound - # Channel: Push Notifications Platform: Huawei ⚠Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: \"/res/raw/notification\" + # Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: \"/res/raw/notification\" attr_accessor :huawei_sound - # Channel: Push Notifications Platform: Amazon ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" + # Channel: Push Notifications Platform: Amazon ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" attr_accessor :adm_sound # Channel: Push Notifications Platform: Windows Sound file that is included in your app to play instead of the default device notification sound. Example: \"notification.wav\" attr_accessor :wp_wns_sound - # Channel: Push Notifications Platform: Android ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): \"FF0000FF\" + # Channel: Push Notifications Platform: Android ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): \"FF0000FF\" attr_accessor :android_led_color - # Channel: Push Notifications Platform: Huawei ⚠Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): \"0000FF\" + # Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): \"0000FF\" attr_accessor :huawei_led_color # Channel: Push Notifications Platform: Android Sets the background color of the notification circle to the left of the notification text. Only applies to apps targeting Android API level 21+ on Android 5.0+ devices. Example(Red): \"FFFF0000\" attr_accessor :android_accent_color - # Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device’s theme color if not set. + # Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device's theme color if not set. attr_accessor :huawei_accent_color - # Channel: Push Notifications Platform: Android 5.0_ ⚠Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) + # Channel: Push Notifications Platform: Android 5.0_ ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) attr_accessor :android_visibility - # Channel: Push Notifications Platform: Huawei ⚠Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) + # Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) attr_accessor :huawei_visibility # Channel: Push Notifications Platform: iOS Describes whether to set or increase/decrease your app's iOS badge count by the ios_badgeCount specified count. Can specify None, SetTo, or Increase. `None` leaves the count unaffected. `SetTo` directly sets the badge count to the number specified in ios_badgeCount. `Increase` adds the number specified in ios_badgeCount to the total. Use a negative number to decrease the badge count. @@ -255,7 +255,7 @@ class NotificationAllOf attr_accessor :summary_arg_count # Channel: Email Required. The subject of the email. - attr_accessor :email_subect + attr_accessor :email_subject # Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. attr_accessor :email_body @@ -379,7 +379,7 @@ def self.attribute_map :'thread_id' => :'thread_id', :'summary_arg' => :'summary_arg', :'summary_arg_count' => :'summary_arg_count', - :'email_subect' => :'email_subect', + :'email_subject' => :'email_subject', :'email_body' => :'email_body', :'email_from_name' => :'email_from_name', :'email_from_address' => :'email_from_address', @@ -464,7 +464,7 @@ def self.openapi_types :'collapse_id' => :'String', :'web_push_topic' => :'String', :'apns_alert' => :'Object', - :'send_after' => :'String', + :'send_after' => :'Time', :'delayed_option' => :'String', :'delivery_time_of_day' => :'String', :'ttl' => :'Integer', @@ -478,7 +478,7 @@ def self.openapi_types :'thread_id' => :'String', :'summary_arg' => :'String', :'summary_arg_count' => :'Integer', - :'email_subect' => :'String', + :'email_subject' => :'String', :'email_body' => :'String', :'email_from_name' => :'String', :'email_from_address' => :'String', @@ -490,6 +490,25 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'is_ios', + :'is_android', + :'is_huawei', + :'is_any_web', + :'is_chrome_web', + :'is_firefox', + :'is_safari', + :'is_wp_wns', + :'is_adm', + :'is_chrome', + :'contents', + :'headings', + :'subtitle', + :'content_available', + :'android_visibility', + :'huawei_visibility', + :'ios_badge_count', + :'ttl', + :'priority', ]) end @@ -842,8 +861,8 @@ def initialize(attributes = {}) self.summary_arg_count = attributes[:'summary_arg_count'] end - if attributes.key?(:'email_subect') - self.email_subect = attributes[:'email_subect'] + if attributes.key?(:'email_subject') + self.email_subject = attributes[:'email_subject'] end if attributes.key?(:'email_body') @@ -981,7 +1000,7 @@ def ==(o) thread_id == o.thread_id && summary_arg == o.summary_arg && summary_arg_count == o.summary_arg_count && - email_subect == o.email_subect && + email_subject == o.email_subject && email_body == o.email_body && email_from_name == o.email_from_name && email_from_address == o.email_from_address && @@ -998,7 +1017,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [id, value, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, channel_for_external_user_ids, app_id, external_id, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, send_after, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, email_subect, email_body, email_from_name, email_from_address, sms_from, sms_media_urls].hash + [id, value, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, channel_for_external_user_ids, app_id, external_id, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, send_after, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, email_subject, email_body, email_from_name, email_from_address, sms_from, sms_media_urls].hash end # Builds the object from hash @@ -1013,6 +1032,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/notification_all_of_android_background_layout.rb b/lib/onesignal/models/notification_all_of_android_background_layout.rb index 540d09a..9d56822 100644 --- a/lib/onesignal/models/notification_all_of_android_background_layout.rb +++ b/lib/onesignal/models/notification_all_of_android_background_layout.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -129,6 +129,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/notification_slice.rb b/lib/onesignal/models/notification_slice.rb index 25ded4e..32821ff 100644 --- a/lib/onesignal/models/notification_slice.rb +++ b/lib/onesignal/models/notification_slice.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -44,7 +44,7 @@ def self.openapi_types :'total_count' => :'Integer', :'offset' => :'Integer', :'limit' => :'Integer', - :'notifications' => :'Array' + :'notifications' => :'Array' } end @@ -136,6 +136,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/notification_target.rb b/lib/onesignal/models/notification_target.rb index 1f28e7c..4d371aa 100644 --- a/lib/onesignal/models/notification_target.rb +++ b/lib/onesignal/models/notification_target.rb @@ -3,10 +3,10 @@ #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: 1.0.0 +The version of the OpenAPI document: 1.0.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.2.0-SNAPSHOT +OpenAPI Generator version: 6.0.0-SNAPSHOT =end @@ -60,7 +60,7 @@ class NotificationTarget # Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call attr_accessor :include_player_ids - # Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [“custom-id-assigned-by-api”] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. + # Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. attr_accessor :include_external_user_ids # Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call @@ -383,6 +383,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) diff --git a/lib/onesignal/models/notification_with_meta.rb b/lib/onesignal/models/notification_with_meta.rb new file mode 100644 index 0000000..5989d9c --- /dev/null +++ b/lib/onesignal/models/notification_with_meta.rb @@ -0,0 +1,1526 @@ +=begin +#OneSignal + +#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: 1.0.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class NotificationWithMeta + # The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] + attr_accessor :included_segments + + # Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"] + attr_accessor :excluded_segments + + # relation = \">\" or \"<\" hours_ago = number of hours before or after the users last session. Example: \"1.1\" + attr_accessor :last_session + + # relation = \">\" or \"<\" hours_ago = number of hours before or after the users first session. Example: \"1.1\" + attr_accessor :first_session + + # relation = \">\", \"<\", \"=\" or \"!=\" value = number sessions. Example: \"1\" + attr_accessor :session_count + + # relation = \">\", \"<\", \"=\" or \"!=\" value = Time in seconds the user has been in your app. Example: \"3600\" + attr_accessor :session_time + + # relation = \">\", \"<\", or \"=\" value = Amount in USD a user has spent on IAP (In App Purchases). Example: \"0.99\" + attr_accessor :amount_spent + + # relation = \">\", \"<\" or \"=\" key = SKU purchased in your app as an IAP (In App Purchases). Example: \"com.domain.100coinpack\" value = value of SKU to compare to. Example: \"0.99\" + attr_accessor :bought_sku + + # relation = \">\", \"<\", \"=\", \"!=\", \"exists\", \"not_exists\", \"time_elapsed_gt\" (paid plan only) or \"time_elapsed_lt\" (paid plan only) See Time Operators key = Tag key to compare. value = Tag value to compare. Not required for \"exists\" or \"not_exists\". Example: See Formatting Filters + attr_accessor :tag + + # relation = \"=\" or \"!=\" value = 2 character language code. Example: \"en\". For a list of all language codes see Language & Localization. + attr_accessor :language + + # relation = \">\", \"<\", \"=\" or \"!=\" value = app version. Example: \"1.0.0\" + attr_accessor :app_version + + # radius = in meters lat = latitude long = longitude + attr_accessor :location + + # value = email address Only for sending Push Notifications Use this for targeting push subscribers associated with an email set with all SDK setEmail methods To send emails to specific email addresses use include_email_tokens parameter + attr_accessor :email + + # relation = \"=\" value = 2-digit Country code Example: \"field\": \"country\", \"relation\": \"=\", \"value\", \"US\" + attr_accessor :country + + # Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call + attr_accessor :include_player_ids + + # Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms. + attr_accessor :include_external_user_ids + + # Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call + attr_accessor :include_email_tokens + + # Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call + attr_accessor :include_phone_numbers + + # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call + attr_accessor :include_ios_tokens + + # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call + attr_accessor :include_wp_wns_uris + + # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call + attr_accessor :include_amazon_reg_ids + + # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call + attr_accessor :include_chrome_reg_ids + + # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call + attr_accessor :include_chrome_web_reg_ids + + # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call + attr_accessor :include_android_reg_ids + + attr_accessor :id + + attr_accessor :value + + attr_accessor :aggregation + + # Indicates whether to send to all devices registered under your app's Apple iOS platform. + attr_accessor :is_ios + + # Indicates whether to send to all devices registered under your app's Google Android platform. + attr_accessor :is_android + + # Indicates whether to send to all devices registered under your app's Huawei Android platform. + attr_accessor :is_huawei + + # Indicates whether to send to all subscribed web browser users, including Chrome, Firefox, and Safari. You may use this instead as a combined flag instead of separately enabling isChromeWeb, isFirefox, and isSafari, though the three options are equivalent to this one. + attr_accessor :is_any_web + + # Indicates whether to send to all Google Chrome, Chrome on Android, and Mozilla Firefox users registered under your Chrome & Firefox web push platform. + attr_accessor :is_chrome_web + + # Indicates whether to send to all Mozilla Firefox desktop users registered under your Firefox web push platform. + attr_accessor :is_firefox + + # Does not support iOS Safari. Indicates whether to send to all Apple's Safari desktop users registered under your Safari web push platform. Read more iOS Safari + attr_accessor :is_safari + + # Indicates whether to send to all devices registered under your app's Windows platform. + attr_accessor :is_wp_wns + + # Indicates whether to send to all devices registered under your app's Amazon Fire platform. + attr_accessor :is_adm + + # This flag is not used for web push Please see isChromeWeb for sending to web push users. This flag only applies to Google Chrome Apps & Extensions. Indicates whether to send to all devices registered under your app's Google Chrome Apps & Extension platform. + attr_accessor :is_chrome + + # Indicates if the message type when targeting with include_external_user_ids for cases where an email, sms, and/or push subscribers have the same external user id. Example: Use the string \"push\" to indicate you are sending a push notification or the string \"email\"for sending emails or \"sms\"for sending SMS. + attr_accessor :channel_for_external_user_ids + + # Required: Your OneSignal Application ID, which can be found in Keys & IDs. It is a UUID and looks similar to 8250eaf6-1a58-489e-b136-7c74a864b434. + attr_accessor :app_id + + # Correlation and idempotency key. A request received with this parameter will first look for another notification with the same external_id. If one exists, a notification will not be sent, and result of the previous operation will instead be returned. Therefore, if you plan on using this feature, it's important to use a good source of randomness to generate the UUID passed here. This key is only idempotent for 30 days. After 30 days, the notification could be removed from our system and a notification with the same external_id will be sent again. See Idempotent Notification Requests for more details writeOnly: true + attr_accessor :external_id + + attr_accessor :contents + + attr_accessor :headings + + attr_accessor :subtitle + + # Channel: Push Notifications Platform: Huawei A custom map of data that is passed back to your app. Same as using Additional Data within the dashboard. Can use up to 2048 bytes of data. Example: {\"abc\": 123, \"foo\": \"bar\", \"event_performed\": true, \"amount\": 12.1} + attr_accessor :data + + # Channel: Push Notifications Platform: Huawei Use \"data\" or \"message\" depending on the type of notification you are sending. More details in Data & Background Notifications. + attr_accessor :huawei_msg_type + + # Channel: Push Notifications Platform: All The URL to open in the browser when a user clicks on the notification. Note: iOS needs https or updated NSAppTransportSecurity in plist This field supports inline substitutions. Omit if including web_url or app_url Example: https://onesignal.com + attr_accessor :url + + # Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including Chrome, Firefox, Safari, Opera, etc. Example: https://onesignal.com + attr_accessor :web_url + + # Channel: Push Notifications Platform: All Browsers Same as url but only sent to web push platforms. Including iOS, Android, macOS, Windows, ChromeApps, etc. Example: https://onesignal.com + attr_accessor :app_url + + # Channel: Push Notifications Platform: iOS 10+ Adds media attachments to notifications. Set as JSON object, key as a media id of your choice and the value as a valid local filename or URL. User must press and hold on the notification to view. Do not set mutable_content to download attachments. The OneSignal SDK does this automatically Example: {\"id1\": \"https://domain.com/image.jpg\"} + attr_accessor :ios_attachments + + # Channel: Push Notifications Platform: All Use a template you setup on our dashboard. The template_id is the UUID found in the URL when viewing a template on our dashboard. Example: be4a8044-bbd6-11e4-a581-000c2940e62c + attr_accessor :template_id + + # Channel: Push Notifications Platform: iOS Sending true wakes your app from background to run custom native code (Apple interprets this as content-available=1). Note: Not applicable if the app is in the \"force-quit\" state (i.e app was swiped away). Omit the contents field to prevent displaying a visible notification. + attr_accessor :content_available + + # Channel: Push Notifications Platform: iOS 10+ Always defaults to true and cannot be turned off. Allows tracking of notification receives and changing of the notification content in your app before it is displayed. Triggers didReceive(_:withContentHandler:) on your UNNotificationServiceExtension. + attr_accessor :mutable_content + + # Channel: Push Notifications Platform: iOS 13+ Use to target a specific experience in your App Clip, or to target your notification to a specific window in a multi-scene App. + attr_accessor :target_content_identifier + + # Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. + attr_accessor :big_picture + + # Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. + attr_accessor :huawei_big_picture + + # Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. + attr_accessor :adm_big_picture + + # Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. + attr_accessor :chrome_big_picture + + # Channel: Push Notifications Platform: Chrome 56+ Sets the web push notification's large image to be shown below the notification's title and text. Please see Web Push Notification Icons. + attr_accessor :chrome_web_image + + # Channel: Push Notifications Platform: iOS 8.0+, Android 4.1+, and derivatives like Amazon Buttons to add to the notification. Icon only works for Android. Buttons show in reverse order of array position i.e. Last item in array shows as first button on device. Example: [{\"id\": \"id2\", \"text\": \"second button\", \"icon\": \"ic_menu_share\"}, {\"id\": \"id1\", \"text\": \"first button\", \"icon\": \"ic_menu_send\"}] + attr_accessor :buttons + + # Channel: Push Notifications Platform: Chrome 48+ Add action buttons to the notification. The id field is required. Example: [{\"id\": \"like-button\", \"text\": \"Like\", \"icon\": \"http://i.imgur.com/N8SN8ZS.png\", \"url\": \"https://yoursite.com\"}, {\"id\": \"read-more-button\", \"text\": \"Read more\", \"icon\": \"http://i.imgur.com/MIxJp1L.png\", \"url\": \"https://yoursite.com\"}] + attr_accessor :web_buttons + + # Channel: Push Notifications Platform: iOS Category APS payload, use with registerUserNotificationSettings:categories in your Objective-C / Swift code. Example: calendar category which contains actions like accept and decline iOS 10+ This will trigger your UNNotificationContentExtension whose ID matches this category. + attr_accessor :ios_category + + # Channel: Push Notifications Platform: Android The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. + attr_accessor :android_channel_id + + # Channel: Push Notifications Platform: Huawei The Android Oreo Notification Category to send the notification under. See the Category documentation on creating one and getting it's id. + attr_accessor :huawei_channel_id + + # Channel: Push Notifications Platform: Android Use this if you have client side Android Oreo Channels you have already defined in your app with code. + attr_accessor :existing_android_channel_id + + # Channel: Push Notifications Platform: Huawei Use this if you have client side Android Oreo Channels you have already defined in your app with code. + attr_accessor :huawei_existing_channel_id + + attr_accessor :android_background_layout + + # Channel: Push Notifications Platform: Android Icon shown in the status bar and on the top left of the notification. If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons + attr_accessor :small_icon + + # Channel: Push Notifications Platform: Huawei Icon shown in the status bar and on the top left of the notification. Use an Android resource path (E.g. /drawable/small_icon). Defaults to your app icon if not set. + attr_accessor :huawei_small_icon + + # Channel: Push Notifications Platform: Android Can be a drawable resource name or a URL. See: How to create large icons + attr_accessor :large_icon + + # Channel: Push Notifications Platform: Huawei Can be a drawable resource name or a URL. See: How to create large icons + attr_accessor :huawei_large_icon + + # Channel: Push Notifications Platform: Amazon If not set a bell icon will be used or ic_stat_onesignal_default if you have set this resource name. See: How to create small icons + attr_accessor :adm_small_icon + + # Channel: Push Notifications Platform: Amazon If blank the small_icon is used. Can be a drawable resource name or a URL. See: How to create large icons + attr_accessor :adm_large_icon + + # Channel: Push Notifications Platform: Chrome Sets the web push notification's icon. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. Firefox will also use this icon, unless you specify firefox_icon. + attr_accessor :chrome_web_icon + + # Channel: Push Notifications Platform: Chrome Sets the web push notification icon for Android devices in the notification shade. Please see Web Push Notification Badge. + attr_accessor :chrome_web_badge + + # Channel: Push Notifications Platform: Firefox Not recommended Few people need to set Firefox-specific icons. We recommend setting chrome_web_icon instead, which Firefox will also use. Sets the web push notification's icon for Firefox. An image URL linking to a valid image. Common image types are supported; GIF will not animate. We recommend 256x256 (at least 80x80) to display well on high DPI devices. + attr_accessor :firefox_icon + + # Channel: Push Notifications Platform: ChromeApp This flag is not used for web push For web push, please see chrome_web_icon instead. The local URL to an icon to use. If blank, the app icon will be used. + attr_accessor :chrome_icon + + # Channel: Push Notifications Platform: iOS Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable vibration and sound for the notification. Example: \"notification.wav\" + attr_accessor :ios_sound + + # Channel: Push Notifications Platform: Android ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" + attr_accessor :android_sound + + # Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sound file that is included in your app to play instead of the default device notification sound. NOTE: Leave off file extension for and include the full path. Example: \"/res/raw/notification\" + attr_accessor :huawei_sound + + # Channel: Push Notifications Platform: Amazon ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sound file that is included in your app to play instead of the default device notification sound. Pass nil to disable sound for the notification. NOTE: Leave off file extension for Android. Example: \"notification\" + attr_accessor :adm_sound + + # Channel: Push Notifications Platform: Windows Sound file that is included in your app to play instead of the default device notification sound. Example: \"notification.wav\" + attr_accessor :wp_wns_sound + + # Channel: Push Notifications Platform: Android ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. Sets the devices LED notification light if the device has one. ARGB Hex format. Example(Blue): \"FF0000FF\" + attr_accessor :android_led_color + + # Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. Sets the devices LED notification light if the device has one. RGB Hex format. Example(Blue): \"0000FF\" + attr_accessor :huawei_led_color + + # Channel: Push Notifications Platform: Android Sets the background color of the notification circle to the left of the notification text. Only applies to apps targeting Android API level 21+ on Android 5.0+ devices. Example(Red): \"FFFF0000\" + attr_accessor :android_accent_color + + # Channel: Push Notifications Platform: Huawei Accent Color used on Action Buttons and Group overflow count. Uses RGB Hex value (E.g. #9900FF). Defaults to device's theme color if not set. + attr_accessor :huawei_accent_color + + # Channel: Push Notifications Platform: Android 5.0_ ⚠️Deprecated, this field doesn't work on Android 8 (Oreo) and newer devices! Please use Notification Categories / Channels noted above instead to support ALL versions of Android. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) + attr_accessor :android_visibility + + # Channel: Push Notifications Platform: Huawei ⚠️Deprecated, this field ONLY works on EMUI 5 (Android 7 based) and older devices. Please also set Notification Categories / Channels noted above to support EMUI 8 (Android 8 based) devices. 1 = Public (default) (Shows the full message on the lock screen unless the user has disabled all notifications from showing on the lock screen. Please consider the user and mark private if the contents are.) 0 = Private (Hides message contents on lock screen if the user set \"Hide sensitive notification content\" in the system settings) -1 = Secret (Notification does not show on the lock screen at all) + attr_accessor :huawei_visibility + + # Channel: Push Notifications Platform: iOS Describes whether to set or increase/decrease your app's iOS badge count by the ios_badgeCount specified count. Can specify None, SetTo, or Increase. `None` leaves the count unaffected. `SetTo` directly sets the badge count to the number specified in ios_badgeCount. `Increase` adds the number specified in ios_badgeCount to the total. Use a negative number to decrease the badge count. + attr_accessor :ios_badge_type + + # Channel: Push Notifications Platform: iOS Used with ios_badgeType, describes the value to set or amount to increase/decrease your app's iOS badge count by. You can use a negative number to decrease the badge count when used with an ios_badgeType of Increase. + attr_accessor :ios_badge_count + + # Channel: Push Notifications Platform: iOS 10+, Android Only one notification with the same id will be shown on the device. Use the same id to update an existing notification instead of showing a new one. Limit of 64 characters. + attr_accessor :collapse_id + + # Channel: Push Notifications Platform: All Browsers Display multiple notifications at once with different topics. + attr_accessor :web_push_topic + + # Channel: Push Notifications Platform: iOS 10+ iOS can localize push notification messages on the client using special parameters such as loc-key. When using the Create Notification endpoint, you must include these parameters inside of a field called apns_alert. Please see Apple's guide on localizing push notifications to learn more. + attr_accessor :apns_alert + + # Unix timestamp indicating when notification delivery should begin. + attr_accessor :send_after + + # Channel: All Possible values are: timezone (Deliver at a specific time-of-day in each users own timezone) last-active Same as Intelligent Delivery . (Deliver at the same time of day as each user last used your app). If send_after is used, this takes effect after the send_after time has elapsed. + attr_accessor :delayed_option + + # Channel: All Use with delayed_option=timezone. Examples: \"9:00AM\" \"21:45\" \"9:45:30\" + attr_accessor :delivery_time_of_day + + # Channel: Push Notifications Platform: iOS, Android, Chrome, Firefox, Safari, ChromeWeb Time To Live - In seconds. The notification will be expired if the device does not come back online within this time. The default is 259,200 seconds (3 days). Max value to set is 2419200 seconds (28 days). + attr_accessor :ttl + + # Channel: Push Notifications Platform: Android, Chrome, ChromeWeb Delivery priority through the push server (example GCM/FCM). Pass 10 for high priority or any other integer for normal priority. Defaults to normal priority for Android and high for iOS. For Android 6.0+ devices setting priority to high will wake the device out of doze mode. + attr_accessor :priority + + # Channel: Push Notifications Platform: iOS valid values: voip Set the value to voip for sending VoIP Notifications This field maps to the APNS header apns-push-type. Note: alert and background are automatically set by OneSignal + attr_accessor :apns_push_type_override + + # number of push notifications sent per minute. Paid Feature Only. If throttling is not enabled for the app or the notification, and for free accounts, null is returned. Refer to Throttling for more details. + attr_accessor :throttle_rate_per_minute + + # Channel: Push Notifications Platform: Android Notifications with the same group will be stacked together using Android's Notification Grouping feature. + attr_accessor :android_group + + # Channel: Push Notifications Platform: Android Note: This only works for Android 6 and older. Android 7+ allows full expansion of all message. Summary message to display when 2+ notifications are stacked together. Default is \"# new messages\". Include $[notif_count] in your message and it will be replaced with the current number. Languages - The value of each key is the message that will be sent to users for that language. \"en\" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. Read more: supported languages. Example: {\"en\": \"You have $[notif_count] new messages\"} + attr_accessor :android_group_message + + # Channel: Push Notifications Platform: Amazon Notifications with the same group will be stacked together using Android's Notification Grouping feature. + attr_accessor :adm_group + + # Channel: Push Notifications Platform: Amazon Summary message to display when 2+ notifications are stacked together. Default is \"# new messages\". Include $[notif_count] in your message and it will be replaced with the current number. \"en\" (English) is required. The key of each hash is either a a 2 character language code or one of zh-Hans/zh-Hant for Simplified or Traditional Chinese. The value of each key is the message that will be sent to users for that language. Example: {\"en\": \"You have $[notif_count] new messages\"} + attr_accessor :adm_group_message + + # Channel: Push Notifications Platform: iOS 12+ This parameter is supported in iOS 12 and above. It allows you to group related notifications together. If two notifications have the same thread-id, they will both be added to the same group. + attr_accessor :thread_id + + # Channel: Push Notifications Platform: iOS 12+ When using thread_id to create grouped notifications in iOS 12+, you can also control the summary. For example, a grouped notification can say \"12 more notifications from John Doe\". The summary_arg lets you set the name of the person/thing the notifications are coming from, and will show up as \"X more notifications from summary_arg\" + attr_accessor :summary_arg + + # Channel: Push Notifications Platform: iOS 12+ When using thread_id, you can also control the count of the number of notifications in the group. For example, if the group already has 12 notifications, and you send a new notification with summary_arg_count = 2, the new total will be 14 and the summary will be \"14 more notifications from summary_arg\" + attr_accessor :summary_arg_count + + # Channel: Email Required. The subject of the email. + attr_accessor :email_subject + + # Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid. + attr_accessor :email_body + + # Channel: Email The name the email is from. If not specified, will default to \"from name\" set in the OneSignal Dashboard Email Settings. + attr_accessor :email_from_name + + # Channel: Email The email address the email is from. If not specified, will default to \"from email\" set in the OneSignal Dashboard Email Settings. + attr_accessor :email_from_address + + # Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. + attr_accessor :sms_from + + # Channel: SMS URLs for the media files to be attached to the SMS content. Limit: 10 media urls with a total max. size of 5MBs. + attr_accessor :sms_media_urls + + # Number of notifications that were successfully delivered. + attr_accessor :successful + + # Number of notifications that could not be delivered due to those devices being unsubscribed. + attr_accessor :failed + + # Number of notifications that could not be delivered due to an error. You can find more information by viewing the notification in the dashboard. + attr_accessor :errored + + # Number of users who have clicked / tapped on your notification. + attr_accessor :converted + + # Confirmed Deliveries number of devices that received the push notification. Paid Feature Only. Free accounts will see 0. + attr_accessor :received + + attr_accessor :outcomes + + # Number of notifications that have not been sent out yet. This can mean either our system is still processing the notification or you have delayed options set. + attr_accessor :remaining + + # Unix timestamp indicating when the notification was created. + attr_accessor :queued_at + + # Unix timestamp indicating when notification delivery completed. The delivery duration from start to finish can be calculated with completed_at - send_after. + attr_accessor :completed_at + + attr_accessor :platform_delivery_stats + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'included_segments' => :'included_segments', + :'excluded_segments' => :'excluded_segments', + :'last_session' => :'last_session', + :'first_session' => :'first_session', + :'session_count' => :'session_count', + :'session_time' => :'session_time', + :'amount_spent' => :'amount_spent', + :'bought_sku' => :'bought_sku', + :'tag' => :'tag', + :'language' => :'language', + :'app_version' => :'app_version', + :'location' => :'location', + :'email' => :'email', + :'country' => :'country', + :'include_player_ids' => :'include_player_ids', + :'include_external_user_ids' => :'include_external_user_ids', + :'include_email_tokens' => :'include_email_tokens', + :'include_phone_numbers' => :'include_phone_numbers', + :'include_ios_tokens' => :'include_ios_tokens', + :'include_wp_wns_uris' => :'include_wp_wns_uris', + :'include_amazon_reg_ids' => :'include_amazon_reg_ids', + :'include_chrome_reg_ids' => :'include_chrome_reg_ids', + :'include_chrome_web_reg_ids' => :'include_chrome_web_reg_ids', + :'include_android_reg_ids' => :'include_android_reg_ids', + :'id' => :'id', + :'value' => :'value', + :'aggregation' => :'aggregation', + :'is_ios' => :'isIos', + :'is_android' => :'isAndroid', + :'is_huawei' => :'isHuawei', + :'is_any_web' => :'isAnyWeb', + :'is_chrome_web' => :'isChromeWeb', + :'is_firefox' => :'isFirefox', + :'is_safari' => :'isSafari', + :'is_wp_wns' => :'isWP_WNS', + :'is_adm' => :'isAdm', + :'is_chrome' => :'isChrome', + :'channel_for_external_user_ids' => :'channel_for_external_user_ids', + :'app_id' => :'app_id', + :'external_id' => :'external_id', + :'contents' => :'contents', + :'headings' => :'headings', + :'subtitle' => :'subtitle', + :'data' => :'data', + :'huawei_msg_type' => :'huawei_msg_type', + :'url' => :'url', + :'web_url' => :'web_url', + :'app_url' => :'app_url', + :'ios_attachments' => :'ios_attachments', + :'template_id' => :'template_id', + :'content_available' => :'content_available', + :'mutable_content' => :'mutable_content', + :'target_content_identifier' => :'target_content_identifier', + :'big_picture' => :'big_picture', + :'huawei_big_picture' => :'huawei_big_picture', + :'adm_big_picture' => :'adm_big_picture', + :'chrome_big_picture' => :'chrome_big_picture', + :'chrome_web_image' => :'chrome_web_image', + :'buttons' => :'buttons', + :'web_buttons' => :'web_buttons', + :'ios_category' => :'ios_category', + :'android_channel_id' => :'android_channel_id', + :'huawei_channel_id' => :'huawei_channel_id', + :'existing_android_channel_id' => :'existing_android_channel_id', + :'huawei_existing_channel_id' => :'huawei_existing_channel_id', + :'android_background_layout' => :'android_background_layout', + :'small_icon' => :'small_icon', + :'huawei_small_icon' => :'huawei_small_icon', + :'large_icon' => :'large_icon', + :'huawei_large_icon' => :'huawei_large_icon', + :'adm_small_icon' => :'adm_small_icon', + :'adm_large_icon' => :'adm_large_icon', + :'chrome_web_icon' => :'chrome_web_icon', + :'chrome_web_badge' => :'chrome_web_badge', + :'firefox_icon' => :'firefox_icon', + :'chrome_icon' => :'chrome_icon', + :'ios_sound' => :'ios_sound', + :'android_sound' => :'android_sound', + :'huawei_sound' => :'huawei_sound', + :'adm_sound' => :'adm_sound', + :'wp_wns_sound' => :'wp_wns_sound', + :'android_led_color' => :'android_led_color', + :'huawei_led_color' => :'huawei_led_color', + :'android_accent_color' => :'android_accent_color', + :'huawei_accent_color' => :'huawei_accent_color', + :'android_visibility' => :'android_visibility', + :'huawei_visibility' => :'huawei_visibility', + :'ios_badge_type' => :'ios_badgeType', + :'ios_badge_count' => :'ios_badgeCount', + :'collapse_id' => :'collapse_id', + :'web_push_topic' => :'web_push_topic', + :'apns_alert' => :'apns_alert', + :'send_after' => :'send_after', + :'delayed_option' => :'delayed_option', + :'delivery_time_of_day' => :'delivery_time_of_day', + :'ttl' => :'ttl', + :'priority' => :'priority', + :'apns_push_type_override' => :'apns_push_type_override', + :'throttle_rate_per_minute' => :'throttle_rate_per_minute', + :'android_group' => :'android_group', + :'android_group_message' => :'android_group_message', + :'adm_group' => :'adm_group', + :'adm_group_message' => :'adm_group_message', + :'thread_id' => :'thread_id', + :'summary_arg' => :'summary_arg', + :'summary_arg_count' => :'summary_arg_count', + :'email_subject' => :'email_subject', + :'email_body' => :'email_body', + :'email_from_name' => :'email_from_name', + :'email_from_address' => :'email_from_address', + :'sms_from' => :'sms_from', + :'sms_media_urls' => :'sms_media_urls', + :'successful' => :'successful', + :'failed' => :'failed', + :'errored' => :'errored', + :'converted' => :'converted', + :'received' => :'received', + :'outcomes' => :'outcomes', + :'remaining' => :'remaining', + :'queued_at' => :'queued_at', + :'completed_at' => :'completed_at', + :'platform_delivery_stats' => :'platform_delivery_stats' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'included_segments' => :'Array', + :'excluded_segments' => :'Array', + :'last_session' => :'String', + :'first_session' => :'String', + :'session_count' => :'String', + :'session_time' => :'String', + :'amount_spent' => :'String', + :'bought_sku' => :'String', + :'tag' => :'String', + :'language' => :'String', + :'app_version' => :'String', + :'location' => :'String', + :'email' => :'String', + :'country' => :'String', + :'include_player_ids' => :'Array', + :'include_external_user_ids' => :'Array', + :'include_email_tokens' => :'Array', + :'include_phone_numbers' => :'Array', + :'include_ios_tokens' => :'Array', + :'include_wp_wns_uris' => :'Array', + :'include_amazon_reg_ids' => :'Array', + :'include_chrome_reg_ids' => :'Array', + :'include_chrome_web_reg_ids' => :'Array', + :'include_android_reg_ids' => :'Array', + :'id' => :'String', + :'value' => :'Integer', + :'aggregation' => :'String', + :'is_ios' => :'Boolean', + :'is_android' => :'Boolean', + :'is_huawei' => :'Boolean', + :'is_any_web' => :'Boolean', + :'is_chrome_web' => :'Boolean', + :'is_firefox' => :'Boolean', + :'is_safari' => :'Boolean', + :'is_wp_wns' => :'Boolean', + :'is_adm' => :'Boolean', + :'is_chrome' => :'Boolean', + :'channel_for_external_user_ids' => :'String', + :'app_id' => :'String', + :'external_id' => :'String', + :'contents' => :'StringMap', + :'headings' => :'StringMap', + :'subtitle' => :'StringMap', + :'data' => :'Object', + :'huawei_msg_type' => :'String', + :'url' => :'String', + :'web_url' => :'String', + :'app_url' => :'String', + :'ios_attachments' => :'Object', + :'template_id' => :'String', + :'content_available' => :'Boolean', + :'mutable_content' => :'Boolean', + :'target_content_identifier' => :'String', + :'big_picture' => :'String', + :'huawei_big_picture' => :'String', + :'adm_big_picture' => :'String', + :'chrome_big_picture' => :'String', + :'chrome_web_image' => :'String', + :'buttons' => :'Array