diff --git a/README.md b/README.md index 98c3b48..afb2f8f 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com - API version: 5.11.0 -- Package version: 5.11.0 +- Package version: 5.11.1 ## Requirements diff --git a/docs/BasicNotification.md b/docs/BasicNotification.md index c243c23..ecb9d1d 100644 --- a/docs/BasicNotification.md +++ b/docs/BasicNotification.md @@ -49,6 +49,7 @@ Name | Type | Description | Notes **mutable_content** | **bool** | 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** | **str, none_type** | 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** | **str, none_type** | Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. | [optional] +**global_image** | **str, none_type** | Channel: Push Notifications Platform: All Picture to display on all platforms that support it. Must be a URL to an image file. Platform-specific picture fields (big_picture, huawei_big_picture, adm_big_picture, chrome_web_image, ios_attachments, firefox_icon) take precedence over this value when set. | [optional] **huawei_big_picture** | **str, none_type** | 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** | **str, none_type** | 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** | **str, none_type** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] diff --git a/docs/BasicNotificationAllOf.md b/docs/BasicNotificationAllOf.md index fa13e78..716c410 100644 --- a/docs/BasicNotificationAllOf.md +++ b/docs/BasicNotificationAllOf.md @@ -35,6 +35,7 @@ Name | Type | Description | Notes **mutable_content** | **bool** | 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** | **str, none_type** | 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** | **str, none_type** | Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. | [optional] +**global_image** | **str, none_type** | Channel: Push Notifications Platform: All Picture to display on all platforms that support it. Must be a URL to an image file. Platform-specific picture fields (big_picture, huawei_big_picture, adm_big_picture, chrome_web_image, ios_attachments, firefox_icon) take precedence over this value when set. | [optional] **huawei_big_picture** | **str, none_type** | 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** | **str, none_type** | 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** | **str, none_type** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 1723aff..ca0ac93 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -22,7 +22,7 @@ Method | HTTP request | Description [**delete_subscription**](DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | [**delete_template**](DefaultApi.md#delete_template) | **DELETE** /templates/{template_id} | Delete template [**delete_user**](DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | -[**export_events**](DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events +[**export_events**](DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events | Export CSV of Events [**export_subscriptions**](DefaultApi.md#export_subscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions [**get_aliases**](DefaultApi.md#get_aliases) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | [**get_aliases_by_subscription**](DefaultApi.md#get_aliases_by_subscription) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | diff --git a/docs/Notification.md b/docs/Notification.md index a8be973..ceab99f 100644 --- a/docs/Notification.md +++ b/docs/Notification.md @@ -49,6 +49,7 @@ Name | Type | Description | Notes **mutable_content** | **bool** | 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** | **str, none_type** | 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** | **str, none_type** | Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. | [optional] +**global_image** | **str, none_type** | Channel: Push Notifications Platform: All Picture to display on all platforms that support it. Must be a URL to an image file. Platform-specific picture fields (big_picture, huawei_big_picture, adm_big_picture, chrome_web_image, ios_attachments, firefox_icon) take precedence over this value when set. | [optional] **huawei_big_picture** | **str, none_type** | 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** | **str, none_type** | 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** | **str, none_type** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] diff --git a/docs/NotificationWithMeta.md b/docs/NotificationWithMeta.md index 4c9922b..876cab4 100644 --- a/docs/NotificationWithMeta.md +++ b/docs/NotificationWithMeta.md @@ -49,6 +49,7 @@ Name | Type | Description | Notes **mutable_content** | **bool** | 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** | **str, none_type** | 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** | **str, none_type** | Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. | [optional] +**global_image** | **str, none_type** | Channel: Push Notifications Platform: All Picture to display on all platforms that support it. Must be a URL to an image file. Platform-specific picture fields (big_picture, huawei_big_picture, adm_big_picture, chrome_web_image, ios_attachments, firefox_icon) take precedence over this value when set. | [optional] **huawei_big_picture** | **str, none_type** | 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** | **str, none_type** | 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** | **str, none_type** | Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. | [optional] diff --git a/onesignal/__init__.py b/onesignal/__init__.py index 4642d2f..5249db8 100644 --- a/onesignal/__init__.py +++ b/onesignal/__init__.py @@ -11,7 +11,7 @@ """ -__version__ = "5.11.0" +__version__ = "5.11.1" # import ApiClient from onesignal.api_client import ApiClient diff --git a/onesignal/api/default_api.py b/onesignal/api/default_api.py index aab725e..2132ac5 100644 --- a/onesignal/api/default_api.py +++ b/onesignal/api/default_api.py @@ -1157,7 +1157,7 @@ def __init__(self, api_client=None): 'auth': [ 'rest_api_key' ], - 'endpoint_path': '/notifications/{notification_id}/export_events?app_id={app_id}', + 'endpoint_path': '/notifications/{notification_id}/export_events', 'operation_id': 'export_events', 'http_method': 'POST', 'servers': None, diff --git a/onesignal/api_client.py b/onesignal/api_client.py index 0da3b26..55415d2 100644 --- a/onesignal/api_client.py +++ b/onesignal/api_client.py @@ -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.11.0/python' + self.user_agent = 'OpenAPI-Generator/5.11.1/python' def __enter__(self): return self @@ -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.11.0" + header_params['OS-Usage-Data'] = "kind=sdk, sdk-name=onesignal-python, version=5.11.1" if self.cookie: header_params['Cookie'] = self.cookie if header_params: diff --git a/onesignal/configuration.py b/onesignal/configuration.py index ec57575..35b0d96 100644 --- a/onesignal/configuration.py +++ b/onesignal/configuration.py @@ -400,7 +400,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 5.11.0\n"\ - "SDK Package Version: 5.11.0".\ + "SDK Package Version: 5.11.1".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/onesignal/model/basic_notification.py b/onesignal/model/basic_notification.py index 21164d3..81b9ec2 100644 --- a/onesignal/model/basic_notification.py +++ b/onesignal/model/basic_notification.py @@ -174,6 +174,7 @@ def openapi_types(): 'mutable_content': (bool,), # noqa: E501 'target_content_identifier': (str, none_type,), # noqa: E501 'big_picture': (str, none_type,), # noqa: E501 + 'global_image': (str, none_type,), # noqa: E501 'huawei_big_picture': (str, none_type,), # noqa: E501 'adm_big_picture': (str, none_type,), # noqa: E501 'chrome_big_picture': (str, none_type,), # noqa: E501 @@ -299,6 +300,7 @@ def discriminator(): 'mutable_content': 'mutable_content', # noqa: E501 'target_content_identifier': 'target_content_identifier', # noqa: E501 'big_picture': 'big_picture', # noqa: E501 + 'global_image': 'global_image', # noqa: E501 'huawei_big_picture': 'huawei_big_picture', # noqa: E501 'adm_big_picture': 'adm_big_picture', # noqa: E501 'chrome_big_picture': 'chrome_big_picture', # noqa: E501 @@ -459,6 +461,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 mutable_content (bool): 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] # noqa: E501 target_content_identifier (str, none_type): 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] # noqa: E501 big_picture (str, none_type): Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 + global_image (str, none_type): Channel: Push Notifications Platform: All Picture to display on all platforms that support it. Must be a URL to an image file. Platform-specific picture fields (big_picture, huawei_big_picture, adm_big_picture, chrome_web_image, ios_attachments, firefox_icon) take precedence over this value when set. . [optional] # noqa: E501 huawei_big_picture (str, none_type): Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 adm_big_picture (str, none_type): Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 chrome_big_picture (str, none_type): Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. . [optional] # noqa: E501 @@ -679,6 +682,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 mutable_content (bool): 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] # noqa: E501 target_content_identifier (str, none_type): 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] # noqa: E501 big_picture (str, none_type): Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 + global_image (str, none_type): Channel: Push Notifications Platform: All Picture to display on all platforms that support it. Must be a URL to an image file. Platform-specific picture fields (big_picture, huawei_big_picture, adm_big_picture, chrome_web_image, ios_attachments, firefox_icon) take precedence over this value when set. . [optional] # noqa: E501 huawei_big_picture (str, none_type): Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 adm_big_picture (str, none_type): Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 chrome_big_picture (str, none_type): Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. . [optional] # noqa: E501 diff --git a/onesignal/model/basic_notification_all_of.py b/onesignal/model/basic_notification_all_of.py index 0460088..8e2ac6c 100644 --- a/onesignal/model/basic_notification_all_of.py +++ b/onesignal/model/basic_notification_all_of.py @@ -149,6 +149,7 @@ def openapi_types(): 'mutable_content': (bool,), # noqa: E501 'target_content_identifier': (str, none_type,), # noqa: E501 'big_picture': (str, none_type,), # noqa: E501 + 'global_image': (str, none_type,), # noqa: E501 'huawei_big_picture': (str, none_type,), # noqa: E501 'adm_big_picture': (str, none_type,), # noqa: E501 'chrome_big_picture': (str, none_type,), # noqa: E501 @@ -260,6 +261,7 @@ def discriminator(): 'mutable_content': 'mutable_content', # noqa: E501 'target_content_identifier': 'target_content_identifier', # noqa: E501 'big_picture': 'big_picture', # noqa: E501 + 'global_image': 'global_image', # noqa: E501 'huawei_big_picture': 'huawei_big_picture', # noqa: E501 'adm_big_picture': 'adm_big_picture', # noqa: E501 'chrome_big_picture': 'chrome_big_picture', # noqa: E501 @@ -408,6 +410,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 mutable_content (bool): 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] # noqa: E501 target_content_identifier (str, none_type): 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] # noqa: E501 big_picture (str, none_type): Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 + global_image (str, none_type): Channel: Push Notifications Platform: All Picture to display on all platforms that support it. Must be a URL to an image file. Platform-specific picture fields (big_picture, huawei_big_picture, adm_big_picture, chrome_web_image, ios_attachments, firefox_icon) take precedence over this value when set. . [optional] # noqa: E501 huawei_big_picture (str, none_type): Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 adm_big_picture (str, none_type): Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 chrome_big_picture (str, none_type): Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. . [optional] # noqa: E501 @@ -596,6 +599,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 mutable_content (bool): 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] # noqa: E501 target_content_identifier (str, none_type): 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] # noqa: E501 big_picture (str, none_type): Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 + global_image (str, none_type): Channel: Push Notifications Platform: All Picture to display on all platforms that support it. Must be a URL to an image file. Platform-specific picture fields (big_picture, huawei_big_picture, adm_big_picture, chrome_web_image, ios_attachments, firefox_icon) take precedence over this value when set. . [optional] # noqa: E501 huawei_big_picture (str, none_type): Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 adm_big_picture (str, none_type): Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 chrome_big_picture (str, none_type): Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. . [optional] # noqa: E501 diff --git a/onesignal/model/notification.py b/onesignal/model/notification.py index 88472b0..25dd2d2 100644 --- a/onesignal/model/notification.py +++ b/onesignal/model/notification.py @@ -174,6 +174,7 @@ def openapi_types(): 'mutable_content': (bool,), # noqa: E501 'target_content_identifier': (str, none_type,), # noqa: E501 'big_picture': (str, none_type,), # noqa: E501 + 'global_image': (str, none_type,), # noqa: E501 'huawei_big_picture': (str, none_type,), # noqa: E501 'adm_big_picture': (str, none_type,), # noqa: E501 'chrome_big_picture': (str, none_type,), # noqa: E501 @@ -300,6 +301,7 @@ def discriminator(): 'mutable_content': 'mutable_content', # noqa: E501 'target_content_identifier': 'target_content_identifier', # noqa: E501 'big_picture': 'big_picture', # noqa: E501 + 'global_image': 'global_image', # noqa: E501 'huawei_big_picture': 'huawei_big_picture', # noqa: E501 'adm_big_picture': 'adm_big_picture', # noqa: E501 'chrome_big_picture': 'chrome_big_picture', # noqa: E501 @@ -461,6 +463,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 mutable_content (bool): 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] # noqa: E501 target_content_identifier (str, none_type): 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] # noqa: E501 big_picture (str, none_type): Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 + global_image (str, none_type): Channel: Push Notifications Platform: All Picture to display on all platforms that support it. Must be a URL to an image file. Platform-specific picture fields (big_picture, huawei_big_picture, adm_big_picture, chrome_web_image, ios_attachments, firefox_icon) take precedence over this value when set. . [optional] # noqa: E501 huawei_big_picture (str, none_type): Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 adm_big_picture (str, none_type): Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 chrome_big_picture (str, none_type): Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. . [optional] # noqa: E501 @@ -682,6 +685,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 mutable_content (bool): 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] # noqa: E501 target_content_identifier (str, none_type): 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] # noqa: E501 big_picture (str, none_type): Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 + global_image (str, none_type): Channel: Push Notifications Platform: All Picture to display on all platforms that support it. Must be a URL to an image file. Platform-specific picture fields (big_picture, huawei_big_picture, adm_big_picture, chrome_web_image, ios_attachments, firefox_icon) take precedence over this value when set. . [optional] # noqa: E501 huawei_big_picture (str, none_type): Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 adm_big_picture (str, none_type): Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 chrome_big_picture (str, none_type): Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. . [optional] # noqa: E501 diff --git a/onesignal/model/notification_with_meta.py b/onesignal/model/notification_with_meta.py index 9cca80b..8e77ac7 100644 --- a/onesignal/model/notification_with_meta.py +++ b/onesignal/model/notification_with_meta.py @@ -179,6 +179,7 @@ def openapi_types(): 'mutable_content': (bool,), # noqa: E501 'target_content_identifier': (str, none_type,), # noqa: E501 'big_picture': (str, none_type,), # noqa: E501 + 'global_image': (str, none_type,), # noqa: E501 'huawei_big_picture': (str, none_type,), # noqa: E501 'adm_big_picture': (str, none_type,), # noqa: E501 'chrome_big_picture': (str, none_type,), # noqa: E501 @@ -317,6 +318,7 @@ def discriminator(): 'mutable_content': 'mutable_content', # noqa: E501 'target_content_identifier': 'target_content_identifier', # noqa: E501 'big_picture': 'big_picture', # noqa: E501 + 'global_image': 'global_image', # noqa: E501 'huawei_big_picture': 'huawei_big_picture', # noqa: E501 'adm_big_picture': 'adm_big_picture', # noqa: E501 'chrome_big_picture': 'chrome_big_picture', # noqa: E501 @@ -490,6 +492,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 mutable_content (bool): 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] # noqa: E501 target_content_identifier (str, none_type): 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] # noqa: E501 big_picture (str, none_type): Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 + global_image (str, none_type): Channel: Push Notifications Platform: All Picture to display on all platforms that support it. Must be a URL to an image file. Platform-specific picture fields (big_picture, huawei_big_picture, adm_big_picture, chrome_web_image, ios_attachments, firefox_icon) take precedence over this value when set. . [optional] # noqa: E501 huawei_big_picture (str, none_type): Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 adm_big_picture (str, none_type): Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 chrome_big_picture (str, none_type): Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. . [optional] # noqa: E501 @@ -723,6 +726,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 mutable_content (bool): 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] # noqa: E501 target_content_identifier (str, none_type): 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] # noqa: E501 big_picture (str, none_type): Channel: Push Notifications Platform: Android Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 + global_image (str, none_type): Channel: Push Notifications Platform: All Picture to display on all platforms that support it. Must be a URL to an image file. Platform-specific picture fields (big_picture, huawei_big_picture, adm_big_picture, chrome_web_image, ios_attachments, firefox_icon) take precedence over this value when set. . [optional] # noqa: E501 huawei_big_picture (str, none_type): Channel: Push Notifications Platform: Huawei Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 adm_big_picture (str, none_type): Channel: Push Notifications Platform: Amazon Picture to display in the expanded view. Can be a drawable resource name or a URL. . [optional] # noqa: E501 chrome_big_picture (str, none_type): Channel: Push Notifications Platform: ChromeApp Large picture to display below the notification text. Must be a local URL. . [optional] # noqa: E501 diff --git a/onesignal/rest.py b/onesignal/rest.py index c87d33a..c04083c 100644 --- a/onesignal/rest.py +++ b/onesignal/rest.py @@ -36,11 +36,11 @@ def __init__(self, resp): def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() + return self.urllib3_response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) + return self.urllib3_response.headers.get(name, default) class RESTClientObject(object): @@ -215,6 +215,12 @@ def request(self, method, url, query_params=None, headers=None, logger.debug("response body: %s", r.data) if not 200 <= r.status <= 299: + # Ensure the exception constructors always receive a RESTResponse: + # they call getheaders(), which raw urllib3 2.x responses no longer + # provide. When _preload_content is True, r is already wrapped. + if not isinstance(r, RESTResponse): + r = RESTResponse(r) + if r.status == 401: raise UnauthorizedException(http_resp=r) diff --git a/setup.py b/setup.py index 1c79461..529fed4 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "onesignal_python_api" -VERSION = "5.11.0" +VERSION = "5.11.1" # To install the library, run the following # # python setup.py install