Skip to content
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ pip install apimatic-core-interfaces
```

## Interfaces
| Name | Description |
|--------------------------------------------------------------------------- |------------------------------------------------------------------------------------------|
| [`HttpClient`](apimatic_core_interfaces/client/http_client.py) | To save both Request and Response after the completion of response |
| [`ResponseFactory`](apimatic_core_interfaces/factories/response_factory.py)| To convert the client-adapter response into a custom HTTP response |
| [`Authentication`](apimatic_core_interfaces/types/authentication.py) | To setup methods for the validation and application of the required authentication scheme|
| Name | Description |
|-----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|
| [`HttpClient`](apimatic_core_interfaces/client/http_client.py) | To save both Request and Response after the completion of response |
| [`ResponseFactory`](apimatic_core_interfaces/factories/response_factory.py) | To convert the client-adapter response into a custom HTTP response |
| [`Authentication`](apimatic_core_interfaces/types/authentication.py) | To setup methods for the validation and application of the required authentication scheme |
| [`UnionType`](apimatic_core_interfaces/types/union_type.py) | To setup methods for the validation and deserialization of OneOf/AnyOf union types |


## Enumerations
Expand Down
3 changes: 2 additions & 1 deletion apimatic_core_interfaces/types/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
__all__ = [
'http_method_enum',
'authentication'
'authentication',
'union_type'
]
22 changes: 22 additions & 0 deletions apimatic_core_interfaces/types/union_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from abc import ABC, abstractmethod


class UnionType(ABC):
NATIVE_TYPES = [int, str, float, bool]

def __init__(self, union_types, union_type_context):
self._union_types = union_types
self._union_type_context = union_type_context
self.is_valid = False
self.error_messages = set()

@abstractmethod
def validate(self, value):
...

@abstractmethod
def deserialize(self, value):
...

def get_context(self):
return self._union_type_context
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setup(
name='apimatic-core-interfaces',
version='0.1.3',
version='0.1.4',
description='An abstract layer of the functionalities provided by apimatic-core-library, requests-client-adapter '
'and APIMatic SDKs.',
long_description=long_description,
Expand Down