Skip to content

Commit b5b483f

Browse files
onesignal-deployOneSignal
andauthored
feat: add Huawei and email_reply_to_address parameters to Notification (#37)
Co-authored-by: OneSignal <noreply@onesignal.com>
1 parent 71425f9 commit b5b483f

12 files changed

Lines changed: 395 additions & 46 deletions

.github/workflows/release.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
release:
10+
name: Create GitHub Release
11+
runs-on: ubuntu-latest
12+
outputs:
13+
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
14+
permissions:
15+
contents: write
16+
issues: write
17+
pull-requests: write
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v5
21+
with:
22+
fetch-depth: 0
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Create GitHub Release
25+
id: semantic
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
output=$(npx -p semantic-release \
30+
-p @semantic-release/changelog \
31+
-p @semantic-release/git \
32+
-p @semantic-release/github \
33+
-p conventional-changelog-conventionalcommits \
34+
semantic-release 2>&1) && exit_code=0 || exit_code=$?
35+
echo "$output"
36+
if echo "$output" | grep -q "Published release"; then
37+
echo "new_release_published=true" >> "$GITHUB_OUTPUT"
38+
else
39+
echo "new_release_published=false" >> "$GITHUB_OUTPUT"
40+
fi
41+
exit $exit_code
42+
43+
publish:
44+
name: Publish to crates.io
45+
needs: release
46+
if: needs.release.outputs.new_release_published == 'true'
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v5
50+
51+
- name: Set up Rust
52+
uses: actions-rs/toolchain@v1
53+
with:
54+
toolchain: stable
55+
override: true
56+
profile: minimal
57+
58+
- name: Cache cargo registry
59+
uses: actions/cache@v3
60+
with:
61+
path: ~/.cargo/registry
62+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
63+
64+
- name: Cache cargo index
65+
uses: actions/cache@v3
66+
with:
67+
path: ~/.cargo/git
68+
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
69+
70+
- name: Cache target directory
71+
uses: actions/cache@v3
72+
with:
73+
path: target
74+
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}
75+
76+
- name: Run tests
77+
run: cargo test --all-features
78+
continue-on-error: true
79+
80+
- name: Build release
81+
run: cargo build --release
82+
83+
- name: Publish to crates.io
84+
uses: katyo/publish-crates@v2
85+
with:
86+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
87+
88+
- name: Upload build artifacts
89+
uses: actions/upload-artifact@v4
90+
if: always()
91+
with:
92+
name: rust-artifacts
93+
path: target/release/

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "onesignal-rust-api"
3-
version = "5.3.0-beta1"
3+
version = "5.3.0"
44
authors = ["devrel@onesignal.com"]
55
edition = "2018"
66
description = "A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ For more information, please visit [https://onesignal.com](https://onesignal.com
99
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client.
1010

1111
- API version: 5.3.0
12-
- Package version: 5.3.0-beta1
12+
- Package version: 5.3.0
1313
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`
1414
- GitHub repository: [https://github.com/onesignal/onesignal-rust-api](https://github.com/onesignal/onesignal-rust-api)
1515

docs/BasicNotification.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,19 @@ Name | Type | Description | Notes
105105
**email_body** | Option<**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]
106106
**email_from_name** | Option<**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]
107107
**email_from_address** | Option<**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]
108+
**email_reply_to_address** | Option<**String**> | Channel: Email The email address where replies should be sent. If not specified, replies will go to the from address. | [optional]
108109
**email_preheader** | Option<**String**> | 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]
109110
**disable_email_click_tracking** | Option<**bool**> | 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]
110111
**include_unsubscribed** | Option<**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]
111112
**sms_from** | Option<**String**> | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional]
112113
**sms_media_urls** | Option<**Vec<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]
113114
**filters** | Option<[**Vec<crate::models::FilterExpression>**](FilterExpression.md)> | | [optional]
114115
**custom_data** | Option<[**serde_json::Value**](.md)> | 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]
116+
**huawei_badge_class** | Option<**String**> | Channel: Push Notifications Platform: Huawei Full path of the app entry activity class | [optional]
117+
**huawei_badge_add_num** | Option<**i32**> | Channel: Push Notifications Platform: Huawei Accumulative badge number, which is an integer ranging from 1 to 99 | [optional]
118+
**huawei_badge_set_num** | Option<**i32**> | Channel: Push Notifications Platform: Huawei Badge number, which is an integer ranging from 0 to 99 | [optional]
119+
**huawei_category** | Option<**String**> | Channel: Push Notifications Platform: Huawei Category of the push notification for HMS classification. | [optional]
120+
**huawei_bi_tag** | Option<**String**> | Channel: Push Notifications Platform: Huawei A tag used for Huawei business intelligence and analytics. | [optional]
115121

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

docs/BasicNotificationAllOf.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,19 @@ Name | Type | Description | Notes
9292
**email_body** | Option<**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]
9393
**email_from_name** | Option<**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]
9494
**email_from_address** | Option<**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]
95+
**email_reply_to_address** | Option<**String**> | Channel: Email The email address where replies should be sent. If not specified, replies will go to the from address. | [optional]
9596
**email_preheader** | Option<**String**> | 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]
9697
**disable_email_click_tracking** | Option<**bool**> | 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]
9798
**include_unsubscribed** | Option<**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]
9899
**sms_from** | Option<**String**> | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional]
99100
**sms_media_urls** | Option<**Vec<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]
100101
**filters** | Option<[**Vec<crate::models::FilterExpression>**](FilterExpression.md)> | | [optional]
101102
**custom_data** | Option<[**serde_json::Value**](.md)> | 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]
103+
**huawei_badge_class** | Option<**String**> | Channel: Push Notifications Platform: Huawei Full path of the app entry activity class | [optional]
104+
**huawei_badge_add_num** | Option<**i32**> | Channel: Push Notifications Platform: Huawei Accumulative badge number, which is an integer ranging from 1 to 99 | [optional]
105+
**huawei_badge_set_num** | Option<**i32**> | Channel: Push Notifications Platform: Huawei Badge number, which is an integer ranging from 0 to 99 | [optional]
106+
**huawei_category** | Option<**String**> | Channel: Push Notifications Platform: Huawei Category of the push notification for HMS classification. | [optional]
107+
**huawei_bi_tag** | Option<**String**> | Channel: Push Notifications Platform: Huawei A tag used for Huawei business intelligence and analytics. | [optional]
102108

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

docs/Notification.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,19 @@ Name | Type | Description | Notes
105105
**email_body** | Option<**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]
106106
**email_from_name** | Option<**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]
107107
**email_from_address** | Option<**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]
108+
**email_reply_to_address** | Option<**String**> | Channel: Email The email address where replies should be sent. If not specified, replies will go to the from address. | [optional]
108109
**email_preheader** | Option<**String**> | 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]
109110
**disable_email_click_tracking** | Option<**bool**> | 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]
110111
**include_unsubscribed** | Option<**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]
111112
**sms_from** | Option<**String**> | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional]
112113
**sms_media_urls** | Option<**Vec<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]
113114
**filters** | Option<[**Vec<crate::models::FilterExpression>**](FilterExpression.md)> | | [optional]
114115
**custom_data** | Option<[**serde_json::Value**](.md)> | 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]
116+
**huawei_badge_class** | Option<**String**> | Channel: Push Notifications Platform: Huawei Full path of the app entry activity class | [optional]
117+
**huawei_badge_add_num** | Option<**i32**> | Channel: Push Notifications Platform: Huawei Accumulative badge number, which is an integer ranging from 1 to 99 | [optional]
118+
**huawei_badge_set_num** | Option<**i32**> | Channel: Push Notifications Platform: Huawei Badge number, which is an integer ranging from 0 to 99 | [optional]
119+
**huawei_category** | Option<**String**> | Channel: Push Notifications Platform: Huawei Category of the push notification for HMS classification. | [optional]
120+
**huawei_bi_tag** | Option<**String**> | Channel: Push Notifications Platform: Huawei A tag used for Huawei business intelligence and analytics. | [optional]
115121
**send_after** | Option<**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]
116122

117123
[[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/NotificationWithMeta.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,19 @@ Name | Type | Description | Notes
105105
**email_body** | Option<**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]
106106
**email_from_name** | Option<**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]
107107
**email_from_address** | Option<**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]
108+
**email_reply_to_address** | Option<**String**> | Channel: Email The email address where replies should be sent. If not specified, replies will go to the from address. | [optional]
108109
**email_preheader** | Option<**String**> | 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]
109110
**disable_email_click_tracking** | Option<**bool**> | 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]
110111
**include_unsubscribed** | Option<**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]
111112
**sms_from** | Option<**String**> | Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format. | [optional]
112113
**sms_media_urls** | Option<**Vec<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]
113114
**filters** | Option<[**Vec<crate::models::FilterExpression>**](FilterExpression.md)> | | [optional]
114115
**custom_data** | Option<[**serde_json::Value**](.md)> | 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]
116+
**huawei_badge_class** | Option<**String**> | Channel: Push Notifications Platform: Huawei Full path of the app entry activity class | [optional]
117+
**huawei_badge_add_num** | Option<**i32**> | Channel: Push Notifications Platform: Huawei Accumulative badge number, which is an integer ranging from 1 to 99 | [optional]
118+
**huawei_badge_set_num** | Option<**i32**> | Channel: Push Notifications Platform: Huawei Badge number, which is an integer ranging from 0 to 99 | [optional]
119+
**huawei_category** | Option<**String**> | Channel: Push Notifications Platform: Huawei Category of the push notification for HMS classification. | [optional]
120+
**huawei_bi_tag** | Option<**String**> | Channel: Push Notifications Platform: Huawei A tag used for Huawei business intelligence and analytics. | [optional]
115121
**successful** | Option<**i32**> | Number of notifications that were successfully delivered. | [optional]
116122
**failed** | Option<**i32**> | Number of notifications that could not be delivered due to those devices being unsubscribed. | [optional]
117123
**errored** | Option<**i32**> | 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]

0 commit comments

Comments
 (0)