diff --git a/storage/google/cloud/storage/notification.py b/storage/google/cloud/storage/notification.py index f8d850c4e64d..8ee287bf5fcf 100644 --- a/storage/google/cloud/storage/notification.py +++ b/storage/google/cloud/storage/notification.py @@ -87,7 +87,7 @@ def __init__(self, bucket, topic_name, self._properties['event_types'] = event_types if blob_name_prefix is not None: - self._properties['blob_name_prefix'] = blob_name_prefix + self._properties['object_name_prefix'] = blob_name_prefix self._properties['payload_format'] = payload_format @@ -161,7 +161,7 @@ def event_types(self): def blob_name_prefix(self): """Prefix of blob names for which notification events are published. """ - return self._properties.get('blob_name_prefix') + return self._properties.get('object_name_prefix') @property def payload_format(self): diff --git a/storage/tests/unit/test_notification.py b/storage/tests/unit/test_notification.py index b10a1099bc7f..2832c217c045 100644 --- a/storage/tests/unit/test_notification.py +++ b/storage/tests/unit/test_notification.py @@ -167,7 +167,7 @@ def test_from_api_repr_explicit(self): 'topic': self.TOPIC_ALT_REF, 'custom_attributes': self.CUSTOM_ATTRIBUTES, 'event_types': self.event_types(), - 'blob_name_prefix': self.BLOB_NAME_PREFIX, + 'object_name_prefix': self.BLOB_NAME_PREFIX, 'payload_format': self.payload_format(), 'id': self.NOTIFICATION_ID, 'etag': self.ETAG, @@ -288,7 +288,7 @@ def test_create_w_explicit_client(self): 'topic': self.TOPIC_ALT_REF, 'custom_attributes': self.CUSTOM_ATTRIBUTES, 'event_types': self.event_types(), - 'blob_name_prefix': self.BLOB_NAME_PREFIX, + 'object_name_prefix': self.BLOB_NAME_PREFIX, 'payload_format': self.payload_format(), 'id': self.NOTIFICATION_ID, 'etag': self.ETAG, @@ -311,7 +311,7 @@ def test_create_w_explicit_client(self): 'topic': self.TOPIC_ALT_REF, 'custom_attributes': self.CUSTOM_ATTRIBUTES, 'event_types': self.event_types(), - 'blob_name_prefix': self.BLOB_NAME_PREFIX, + 'object_name_prefix': self.BLOB_NAME_PREFIX, 'payload_format': self.payload_format(), } api_request.assert_called_once_with(