Skip to content

Commit b37e980

Browse files
author
OneSignal
committed
Update Python API
1 parent 9c22823 commit b37e980

14 files changed

Lines changed: 741 additions & 16 deletions

.github/workflows/pip_deploy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: PIP Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-18.04
11+
steps:
12+
- uses: actions/checkout@master
13+
- name: Set up Python 3.10
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: "3.10"
17+
- name: Install pypa/build
18+
run: >-
19+
python -m
20+
pip install
21+
build
22+
--user
23+
- name: Build a binary wheel and a source tarball
24+
run: >-
25+
python -m
26+
build
27+
--sdist
28+
--wheel
29+
--outdir dist/
30+
.
31+
- name: Publish a Python distribution to PyPI
32+
uses: pypa/gh-action-pypi-publish@release/v1
33+
with:
34+
user: __token__
35+
password: ${{ secrets.PYPI_API_TOKEN }}
36+
verbose: true

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ Python >=3.6
3030

3131
## Installation & Usage
3232
### pip install
33+
```sh
34+
pip install onesignal-python-api
35+
```
3336

34-
If the python package is hosted on a repository, you can install directly using:
37+
You can also install directly from GitHub using:
3538

3639
```sh
3740
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
@@ -148,6 +151,8 @@ Class | Method | HTTP request | Description
148151
- [OutcomeData](docs/OutcomeData.md)
149152
- [OutcomesData](docs/OutcomesData.md)
150153
- [PlatformDeliveryData](docs/PlatformDeliveryData.md)
154+
- [PlatformDeliveryDataEmailAllOf](docs/PlatformDeliveryDataEmailAllOf.md)
155+
- [PlatformDeliveryDataSmsAllOf](docs/PlatformDeliveryDataSmsAllOf.md)
151156
- [Player](docs/Player.md)
152157
- [PlayerNotificationTarget](docs/PlayerNotificationTarget.md)
153158
- [PlayerSlice](docs/PlayerSlice.md)

docs/DeliveryData.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**successful** | **int, none_type** | | [optional]
8-
**failed** | **int, none_type** | | [optional]
9-
**errored** | **int, none_type** | | [optional]
10-
**converted** | **int, none_type** | | [optional]
11-
**received** | **int, none_type** | | [optional]
7+
**successful** | **int, none_type** | Number of messages delivered to push servers, mobile carriers, or email service providers. | [optional]
8+
**failed** | **int, none_type** | Number of messages sent to unsubscribed devices. | [optional]
9+
**errored** | **int, none_type** | Number of errors reported. | [optional]
10+
**converted** | **int, none_type** | Number of messages that were clicked. | [optional]
11+
**received** | **int, none_type** | Number of devices that received the message. | [optional]
1212
**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]
1313

1414
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

docs/PlatformDeliveryData.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Name | Type | Description | Notes
1111
**safari_web_push** | [**DeliveryData**](DeliveryData.md) | | [optional]
1212
**android** | [**DeliveryData**](DeliveryData.md) | | [optional]
1313
**ios** | [**DeliveryData**](DeliveryData.md) | | [optional]
14+
**sms** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
15+
**email** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
1416
**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]
1517

1618
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# PlatformDeliveryDataEmailAllOf
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**opened** | **int, none_type** | Number of times an email has been opened. | [optional]
8+
**unique_opens** | **int, none_type** | Number of unique recipients who have opened your email. | [optional]
9+
**clicks** | **int, none_type** | Number of clicked links from your email. This can include the recipient clicking email links multiple times. | [optional]
10+
**unique_clicks** | **int, none_type** | Number of unique clicks that your recipients have made on links from your email. | [optional]
11+
**bounced** | **int, none_type** | Number of recipients who registered as a hard or soft bounce and didn't receive your email. | [optional]
12+
**reported_spam** | **int, none_type** | Number of recipients who reported this email as spam. | [optional]
13+
**unsubscribed** | **int, none_type** | Number of recipients who opted out of your emails using the unsubscribe link in this email. | [optional]
14+
**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]
15+
16+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
17+
18+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# PlatformDeliveryDataSmsAllOf
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**provider_successful** | **int, none_type** | Number of messages reported as delivered successfully by the SMS service provider. | [optional]
8+
**provider_failed** | **int, none_type** | Number of recipients who didn't receive your message as reported by the SMS service provider. | [optional]
9+
**provider_errored** | **int, none_type** | Number of errors reported by the SMS service provider. | [optional]
10+
**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]
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13+
14+

onesignal/model/delivery_data.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
143143
Animal class but this time we won't travel
144144
through its discriminator because we passed in
145145
_visited_composed_classes = (Animal,)
146-
successful (int, none_type): [optional] # noqa: E501
147-
failed (int, none_type): [optional] # noqa: E501
148-
errored (int, none_type): [optional] # noqa: E501
149-
converted (int, none_type): [optional] # noqa: E501
150-
received (int, none_type): [optional] # noqa: E501
146+
successful (int, none_type): Number of messages delivered to push servers, mobile carriers, or email service providers.. [optional] # noqa: E501
147+
failed (int, none_type): Number of messages sent to unsubscribed devices.. [optional] # noqa: E501
148+
errored (int, none_type): Number of errors reported.. [optional] # noqa: E501
149+
converted (int, none_type): Number of messages that were clicked.. [optional] # noqa: E501
150+
received (int, none_type): Number of devices that received the message.. [optional] # noqa: E501
151151
"""
152152

153153
_check_type = kwargs.pop('_check_type', True)
@@ -233,11 +233,11 @@ def __init__(self, *args, **kwargs): # noqa: E501
233233
Animal class but this time we won't travel
234234
through its discriminator because we passed in
235235
_visited_composed_classes = (Animal,)
236-
successful (int, none_type): [optional] # noqa: E501
237-
failed (int, none_type): [optional] # noqa: E501
238-
errored (int, none_type): [optional] # noqa: E501
239-
converted (int, none_type): [optional] # noqa: E501
240-
received (int, none_type): [optional] # noqa: E501
236+
successful (int, none_type): Number of messages delivered to push servers, mobile carriers, or email service providers.. [optional] # noqa: E501
237+
failed (int, none_type): Number of messages sent to unsubscribed devices.. [optional] # noqa: E501
238+
errored (int, none_type): Number of errors reported.. [optional] # noqa: E501
239+
converted (int, none_type): Number of messages that were clicked.. [optional] # noqa: E501
240+
received (int, none_type): Number of devices that received the message.. [optional] # noqa: E501
241241
"""
242242

243243
_check_type = kwargs.pop('_check_type', True)

onesignal/model/platform_delivery_data.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232

3333
def lazy_import():
3434
from onesignal.model.delivery_data import DeliveryData
35+
from onesignal.model.platform_delivery_data_email_all_of import PlatformDeliveryDataEmailAllOf
36+
from onesignal.model.platform_delivery_data_sms_all_of import PlatformDeliveryDataSmsAllOf
3537
globals()['DeliveryData'] = DeliveryData
38+
globals()['PlatformDeliveryDataEmailAllOf'] = PlatformDeliveryDataEmailAllOf
39+
globals()['PlatformDeliveryDataSmsAllOf'] = PlatformDeliveryDataSmsAllOf
3640

3741

3842
class PlatformDeliveryData(ModelNormal):
@@ -94,6 +98,8 @@ def openapi_types():
9498
'safari_web_push': (DeliveryData,), # noqa: E501
9599
'android': (DeliveryData,), # noqa: E501
96100
'ios': (DeliveryData,), # noqa: E501
101+
'sms': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
102+
'email': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
97103
}
98104

99105
@cached_property
@@ -108,6 +114,8 @@ def discriminator():
108114
'safari_web_push': 'safari_web_push', # noqa: E501
109115
'android': 'android', # noqa: E501
110116
'ios': 'ios', # noqa: E501
117+
'sms': 'sms', # noqa: E501
118+
'email': 'email', # noqa: E501
111119
}
112120

113121
read_only_vars = {
@@ -157,6 +165,8 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
157165
safari_web_push (DeliveryData): [optional] # noqa: E501
158166
android (DeliveryData): [optional] # noqa: E501
159167
ios (DeliveryData): [optional] # noqa: E501
168+
sms (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
169+
email (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
160170
"""
161171

162172
_check_type = kwargs.pop('_check_type', True)
@@ -248,6 +258,8 @@ def __init__(self, *args, **kwargs): # noqa: E501
248258
safari_web_push (DeliveryData): [optional] # noqa: E501
249259
android (DeliveryData): [optional] # noqa: E501
250260
ios (DeliveryData): [optional] # noqa: E501
261+
sms (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
262+
email (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
251263
"""
252264

253265
_check_type = kwargs.pop('_check_type', True)

0 commit comments

Comments
 (0)