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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Release

on:
push:
branches: [main]
workflow_dispatch:

jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-latest
outputs:
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub Release
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
output=$(npx -p semantic-release \
-p @semantic-release/changelog \
-p @semantic-release/git \
-p @semantic-release/github \
-p conventional-changelog-conventionalcommits \
semantic-release 2>&1) && exit_code=0 || exit_code=$?
echo "$output"
if echo "$output" | grep -q "Published release"; then
echo "new_release_published=true" >> "$GITHUB_OUTPUT"
else
echo "new_release_published=false" >> "$GITHUB_OUTPUT"
fi
exit $exit_code

publish:
name: Publish to PyPI
needs: release
if: needs.release.outputs.new_release_published == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

- API version: 5.3.0
- Package version: 5.3.0-beta1
- Package version: 5.3.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down
6 changes: 6 additions & 0 deletions docs/BasicNotification.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,19 @@ Name | Type | Description | Notes
**email_body** | **str** | 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** | **str, none_type** | 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** | **str, none_type** | 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]
**email_reply_to_address** | **str, none_type** | Channel: Email The email address where replies should be sent. If not specified, replies will go to the from address. | [optional]
**email_preheader** | **str, none_type** | Channel: Email The preheader text of the email. Preheader is the preview text displayed immediately after an email subject that provides additional context about the email content. If not specified, will default to null. | [optional]
**disable_email_click_tracking** | **bool, none_type** | Channel: Email Default is `false`. If set to `true`, the URLs sent within the email will not include link tracking and will be the same as originally set; otherwise, all the URLs in the email will be tracked. | [optional]
**include_unsubscribed** | **bool** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional]
**sms_from** | **str, none_type** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional]
**sms_media_urls** | **[str], none_type** | 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]
**filters** | [**[FilterExpression], none_type**](FilterExpression.md) | | [optional]
**custom_data** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional]
**huawei_badge_class** | **str, none_type** | Channel: Push Notifications Platform: Huawei Full path of the app entry activity class | [optional]
**huawei_badge_add_num** | **int, none_type** | Channel: Push Notifications Platform: Huawei Accumulative badge number, which is an integer ranging from 1 to 99 | [optional]
**huawei_badge_set_num** | **int, none_type** | Channel: Push Notifications Platform: Huawei Badge number, which is an integer ranging from 0 to 99 | [optional]
**huawei_category** | **str, none_type** | Channel: Push Notifications Platform: Huawei Category of the push notification for HMS classification. | [optional]
**huawei_bi_tag** | **str, none_type** | Channel: Push Notifications Platform: Huawei A tag used for Huawei business intelligence and analytics. | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
6 changes: 6 additions & 0 deletions docs/BasicNotificationAllOf.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,19 @@ Name | Type | Description | Notes
**email_body** | **str** | 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** | **str, none_type** | 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** | **str, none_type** | 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]
**email_reply_to_address** | **str, none_type** | Channel: Email The email address where replies should be sent. If not specified, replies will go to the from address. | [optional]
**email_preheader** | **str, none_type** | Channel: Email The preheader text of the email. Preheader is the preview text displayed immediately after an email subject that provides additional context about the email content. If not specified, will default to null. | [optional]
**disable_email_click_tracking** | **bool, none_type** | Channel: Email Default is `false`. If set to `true`, the URLs sent within the email will not include link tracking and will be the same as originally set; otherwise, all the URLs in the email will be tracked. | [optional]
**include_unsubscribed** | **bool** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional]
**sms_from** | **str, none_type** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional]
**sms_media_urls** | **[str], none_type** | 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]
**filters** | [**[FilterExpression], none_type**](FilterExpression.md) | | [optional]
**custom_data** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional]
**huawei_badge_class** | **str, none_type** | Channel: Push Notifications Platform: Huawei Full path of the app entry activity class | [optional]
**huawei_badge_add_num** | **int, none_type** | Channel: Push Notifications Platform: Huawei Accumulative badge number, which is an integer ranging from 1 to 99 | [optional]
**huawei_badge_set_num** | **int, none_type** | Channel: Push Notifications Platform: Huawei Badge number, which is an integer ranging from 0 to 99 | [optional]
**huawei_category** | **str, none_type** | Channel: Push Notifications Platform: Huawei Category of the push notification for HMS classification. | [optional]
**huawei_bi_tag** | **str, none_type** | Channel: Push Notifications Platform: Huawei A tag used for Huawei business intelligence and analytics. | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
6 changes: 6 additions & 0 deletions docs/Notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,19 @@ Name | Type | Description | Notes
**email_body** | **str** | 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** | **str, none_type** | 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** | **str, none_type** | 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]
**email_reply_to_address** | **str, none_type** | Channel: Email The email address where replies should be sent. If not specified, replies will go to the from address. | [optional]
**email_preheader** | **str, none_type** | Channel: Email The preheader text of the email. Preheader is the preview text displayed immediately after an email subject that provides additional context about the email content. If not specified, will default to null. | [optional]
**disable_email_click_tracking** | **bool, none_type** | Channel: Email Default is `false`. If set to `true`, the URLs sent within the email will not include link tracking and will be the same as originally set; otherwise, all the URLs in the email will be tracked. | [optional]
**include_unsubscribed** | **bool** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional]
**sms_from** | **str, none_type** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional]
**sms_media_urls** | **[str], none_type** | 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]
**filters** | [**[FilterExpression], none_type**](FilterExpression.md) | | [optional]
**custom_data** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional]
**huawei_badge_class** | **str, none_type** | Channel: Push Notifications Platform: Huawei Full path of the app entry activity class | [optional]
**huawei_badge_add_num** | **int, none_type** | Channel: Push Notifications Platform: Huawei Accumulative badge number, which is an integer ranging from 1 to 99 | [optional]
**huawei_badge_set_num** | **int, none_type** | Channel: Push Notifications Platform: Huawei Badge number, which is an integer ranging from 0 to 99 | [optional]
**huawei_category** | **str, none_type** | Channel: Push Notifications Platform: Huawei Category of the push notification for HMS classification. | [optional]
**huawei_bi_tag** | **str, none_type** | Channel: Push Notifications Platform: Huawei A tag used for Huawei business intelligence and analytics. | [optional]
**send_after** | **datetime, none_type** | 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]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

Expand Down
6 changes: 6 additions & 0 deletions docs/NotificationWithMeta.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,19 @@ Name | Type | Description | Notes
**email_body** | **str** | 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** | **str, none_type** | 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** | **str, none_type** | 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]
**email_reply_to_address** | **str, none_type** | Channel: Email The email address where replies should be sent. If not specified, replies will go to the from address. | [optional]
**email_preheader** | **str, none_type** | Channel: Email The preheader text of the email. Preheader is the preview text displayed immediately after an email subject that provides additional context about the email content. If not specified, will default to null. | [optional]
**disable_email_click_tracking** | **bool, none_type** | Channel: Email Default is `false`. If set to `true`, the URLs sent within the email will not include link tracking and will be the same as originally set; otherwise, all the URLs in the email will be tracked. | [optional]
**include_unsubscribed** | **bool** | Channel: Email Default is `false`. This field is used to send transactional notifications. If set to `true`, this notification will also be sent to unsubscribed emails. If a `template_id` is provided, the `include_unsubscribed` value from the template will be inherited. If you are using a third-party ESP, this field requires the ESP's list of unsubscribed emails to be cleared. | [optional]
**sms_from** | **str, none_type** | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional]
**sms_media_urls** | **[str], none_type** | 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]
**filters** | [**[FilterExpression], none_type**](FilterExpression.md) | | [optional]
**custom_data** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | Channel: All JSON object that can be used as a source of message personalization data for fields that support tag variable substitution. Push, SMS: Can accept up to 2048 bytes of valid JSON. Email: Can accept up to 10000 bytes of valid JSON. Example: {\"order_id\": 123, \"currency\": \"USD\", \"amount\": 25} | [optional]
**huawei_badge_class** | **str, none_type** | Channel: Push Notifications Platform: Huawei Full path of the app entry activity class | [optional]
**huawei_badge_add_num** | **int, none_type** | Channel: Push Notifications Platform: Huawei Accumulative badge number, which is an integer ranging from 1 to 99 | [optional]
**huawei_badge_set_num** | **int, none_type** | Channel: Push Notifications Platform: Huawei Badge number, which is an integer ranging from 0 to 99 | [optional]
**huawei_category** | **str, none_type** | Channel: Push Notifications Platform: Huawei Category of the push notification for HMS classification. | [optional]
**huawei_bi_tag** | **str, none_type** | Channel: Push Notifications Platform: Huawei A tag used for Huawei business intelligence and analytics. | [optional]
**successful** | **int** | Number of notifications that were successfully delivered. | [optional]
**failed** | **int** | Number of notifications that could not be delivered due to those devices being unsubscribed. | [optional]
**errored** | **int** | 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]
Expand Down
2 changes: 1 addition & 1 deletion onesignal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"""


__version__ = "5.3.0-beta1"
__version__ = "5.3.0"

# import ApiClient
from onesignal.api_client import ApiClient
Expand Down
4 changes: 2 additions & 2 deletions onesignal/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'OpenAPI-Generator/5.3.0-beta1/python'
self.user_agent = 'OpenAPI-Generator/5.3.0/python'

def __enter__(self):
return self
Expand Down Expand Up @@ -142,7 +142,7 @@ def __call_api(
# header parameters
header_params = header_params or {}
header_params.update(self.default_headers)
header_params['OS-Usage-Data'] = "kind=sdk, sdk-name=onesignal-python, version=5.3.0-beta1"
header_params['OS-Usage-Data'] = "kind=sdk, sdk-name=onesignal-python, version=5.3.0"
if self.cookie:
header_params['Cookie'] = self.cookie
if header_params:
Expand Down
2 changes: 1 addition & 1 deletion onesignal/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 5.3.0\n"\
"SDK Package Version: 5.3.0-beta1".\
"SDK Package Version: 5.3.0".\
format(env=sys.platform, pyversion=sys.version)

def get_host_settings(self):
Expand Down
Loading
Loading