diff --git a/cloudevents/abstract/__init__.py b/cloudevents/generic/__init__.py similarity index 89% rename from cloudevents/abstract/__init__.py rename to cloudevents/generic/__init__.py index c5237ff..2a9e1a4 100644 --- a/cloudevents/abstract/__init__.py +++ b/cloudevents/generic/__init__.py @@ -12,4 +12,4 @@ # License for the specific language governing permissions and limitations # under the License. -from cloudevents.abstract.event import CloudEvent, AnyCloudEvent # noqa +from cloudevents.generic.event import CloudEvent, AnyCloudEvent # noqa diff --git a/cloudevents/abstract/event.py b/cloudevents/generic/event.py similarity index 100% rename from cloudevents/abstract/event.py rename to cloudevents/generic/event.py diff --git a/cloudevents/abstract/http_methods.py b/cloudevents/generic/http_methods.py similarity index 99% rename from cloudevents/abstract/http_methods.py rename to cloudevents/generic/http_methods.py index c68d96d..e6430b2 100644 --- a/cloudevents/abstract/http_methods.py +++ b/cloudevents/generic/http_methods.py @@ -17,7 +17,7 @@ import typing import cloudevents.exceptions as cloud_exceptions -from cloudevents.abstract.event import AnyCloudEvent +from cloudevents.generic.event import AnyCloudEvent from cloudevents.http.event_type import is_binary from cloudevents.http.mappings import _marshaller_by_format, _obj_by_version from cloudevents.http.util import _json_or_string diff --git a/cloudevents/abstract/json_methods.py b/cloudevents/generic/json_methods.py similarity index 94% rename from cloudevents/abstract/json_methods.py rename to cloudevents/generic/json_methods.py index 2e68c95..2dd17cb 100644 --- a/cloudevents/abstract/json_methods.py +++ b/cloudevents/generic/json_methods.py @@ -14,9 +14,9 @@ import typing -from cloudevents.abstract import AnyCloudEvent +from cloudevents.generic import AnyCloudEvent from cloudevents.sdk import types -from cloudevents.abstract.http_methods import to_structured, from_http +from cloudevents.generic.http_methods import to_structured, from_http def to_json( diff --git a/cloudevents/http/event.py b/cloudevents/http/event.py index 8e7eea7..9f1af42 100644 --- a/cloudevents/http/event.py +++ b/cloudevents/http/event.py @@ -18,10 +18,10 @@ import uuid import cloudevents.exceptions as cloud_exceptions from cloudevents.http.mappings import _required_by_version -from cloudevents import abstract +from cloudevents import generic -class CloudEvent(abstract.CloudEvent): +class CloudEvent(generic.CloudEvent): """ Python-friendly cloudevent class supporting v1 events Supports both binary and structured mode CloudEvents diff --git a/cloudevents/http/http_methods.py b/cloudevents/http/http_methods.py index 3a03080..5ba7dcf 100644 --- a/cloudevents/http/http_methods.py +++ b/cloudevents/http/http_methods.py @@ -21,10 +21,10 @@ from cloudevents.http.event import CloudEvent from cloudevents.sdk import types # backwards compatability imports -from cloudevents.abstract.http_methods import to_binary, to_structured # noqa +from cloudevents.generic.http_methods import to_binary, to_structured # noqa -from cloudevents.abstract.http_methods import from_http as _abstract_from_http +from cloudevents.generic.http_methods import from_http as _generic_from_http def from_http( @@ -43,7 +43,7 @@ def from_http( e.g. lambda x: x or lambda x: json.loads(x) :type data_unmarshaller: types.UnmarshallerType """ - return _abstract_from_http(CloudEvent, headers, data, data_unmarshaller) + return _generic_from_http(CloudEvent, headers, data, data_unmarshaller) @deprecated(deprecated_in="1.0.2", details="Use to_binary function instead") diff --git a/cloudevents/http/json_methods.py b/cloudevents/http/json_methods.py index 7b81d3d..39aeb91 100644 --- a/cloudevents/http/json_methods.py +++ b/cloudevents/http/json_methods.py @@ -18,8 +18,8 @@ from cloudevents.http.event import CloudEvent from cloudevents.sdk import types # backwards compatibility -from cloudevents.abstract.json_methods import to_json # noqa -from cloudevents.abstract.json_methods import from_json as _abstract_from_json +from cloudevents.generic.json_methods import to_json # noqa +from cloudevents.generic.json_methods import from_json as _generic_from_json def from_json( @@ -34,4 +34,4 @@ def from_json( :type data_unmarshaller: typing.Callable :returns: CloudEvent representing given cloudevent json object """ - return _abstract_from_json(CloudEvent, data, data_unmarshaller) + return _generic_from_json(CloudEvent, data, data_unmarshaller) diff --git a/cloudevents/tests/test_abstract_cloudevent.py b/cloudevents/tests/test_abstract_cloudevent.py index 06c5cce..59ea305 100644 --- a/cloudevents/tests/test_abstract_cloudevent.py +++ b/cloudevents/tests/test_abstract_cloudevent.py @@ -1,4 +1,4 @@ -from cloudevents.abstract import CloudEvent +from cloudevents.generic import CloudEvent import pytest