diff --git a/ibm_cloud_security_advisor/notifications_api_v1.py b/ibm_cloud_security_advisor/notifications_api_v1.py index e147f53..70181be 100644 --- a/ibm_cloud_security_advisor/notifications_api_v1.py +++ b/ibm_cloud_security_advisor/notifications_api_v1.py @@ -152,7 +152,7 @@ def create_notification_channel(self, account_id: str, name: str, type: str, end 'description': description, 'severity': severity, 'enabled': enabled, - 'alertSource': alert_source + 'alert_source': alert_source } url = '/v1/{0}/notifications/channels'.format(*self._encode_path_vars(account_id)) @@ -309,7 +309,7 @@ def update_notification_channel(self, account_id: str, channel_id: str, name: st 'description': description, 'severity': severity, 'enabled': enabled, - 'alertSource': alert_source + 'alert_source': alert_source } url = '/v1/{0}/notifications/channels/{1}'.format(*self._encode_path_vars(account_id, channel_id)) diff --git a/requirements.txt b/requirements.txt index a9f7776..993c5aa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ jproperties requests>=2.0,<3.0 python_dateutil>=2.5.3 websocket-client==0.48.0 -ibm_cloud_sdk_core>=2.0.0,<3.0.0 +ibm_cloud_sdk_core>=3.0.0 diff --git a/test/integration/notifications_api_v1/test_notification.py b/test/integration/notifications_api_v1/test_notification.py index e5d9678..999bdc1 100644 --- a/test/integration/notifications_api_v1/test_notification.py +++ b/test/integration/notifications_api_v1/test_notification.py @@ -81,11 +81,11 @@ def test_list_all_channels(self): resp = TestNotification.ibm_security_advisor_notifications_api_sdk.list_all_channels( account_id=TestNotification.account_id ) - assert resp.result['channels'][0]['name'] == TestNotification.notification_data[0]['name'] + assert resp.status_code == 200 def test_create_notification_channel(self): print("test_create_notification_channel...") - assert TestNotification.create_notification_channel_resp.result['statusCode'] == 200 + assert TestNotification.create_notification_channel_resp.result['status_code'] == 200 def test_delete_notification_channels(self): print("test_delete_notification_channels...") @@ -94,7 +94,7 @@ def test_delete_notification_channels(self): account_id=TestNotification.account_id, **TestNotification.notification_data[1] ) - assert resp1.result['statusCode'] == 200 + assert resp1.result['status_code'] == 200 TestNotification.notification_data[3]['name'] = generate_unique_name() resp2 = TestNotification.ibm_security_advisor_notifications_api_sdk.create_notification_channel( @@ -102,7 +102,7 @@ def test_delete_notification_channels(self): **TestNotification.notification_data[3] ) - assert resp2.result['statusCode'] == 200 + assert resp2.result['status_code'] == 200 del_resp = TestNotification.ibm_security_advisor_notifications_api_sdk.delete_notification_channels( account_id=TestNotification.account_id, body=[ @@ -120,7 +120,7 @@ def test_delete_notification_channel(self): account_id=TestNotification.account_id, **TestNotification.notification_data[1] ) - assert resp.result['statusCode'] == 200 + assert resp.result['status_code'] == 200 del_resp = TestNotification.ibm_security_advisor_notifications_api_sdk.delete_notification_channel( account_id=TestNotification.account_id, channel_id=resp.result['channel_id'], @@ -143,11 +143,11 @@ def test_update_notification_channel(self): channel_id=TestNotification.create_notification_channel_resp.result['channel_id'], **TestNotification.notification_data[2] ) - assert resp.result['statusCode'] == 200 + assert resp.result['status_code'] == 200 def test_get_public_key(self): print("test_get_public_key...") resp = TestNotification.ibm_security_advisor_notifications_api_sdk.get_public_key( account_id=TestNotification.account_id, ) - assert 'publicKey' in resp.result + assert 'public_key' in resp.result