Skip to content

Commit

Permalink
Merge branch 'release/1.13.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvandegroes committed Feb 19, 2020
2 parents fc6b868 + 20baacf commit f487783
Show file tree
Hide file tree
Showing 95 changed files with 7,805 additions and 7,545 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

## [Unreleased](https://github.com/bunq/sdk_python/tree/HEAD)

[Full Changelog](https://github.com/bunq/sdk_python/compare/1.10.2...HEAD)
[Full Changelog](https://github.com/bunq/sdk_python/compare/1.10.16...HEAD)

**Implemented enhancements:**

- Python SDK Refactor [\#117](https://github.com/bunq/sdk_python/pull/117) ([angelomelonas](https://github.com/angelomelonas))

## [1.10.16](https://github.com/bunq/sdk_python/tree/1.10.16) (2019-06-17)
[Full Changelog](https://github.com/bunq/sdk_python/compare/1.10.2...1.10.16)

**Closed issues:**

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ located in [test](/tests)

## Exceptions
The SDK can raise multiple exceptions. For an overview of these exceptions please
take a look at [EXCEPTIONS.md](./EXCEPTIONS.md)
take a look at [EXCEPTIONS.md](./bunq/sdk/exception/EXCEPTIONS.md)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.2
1.13.0
75 changes: 37 additions & 38 deletions bunq/__init__.py
Original file line number Diff line number Diff line change
@@ -1,53 +1,52 @@
from bunq.sdk.json import converter
from typing import Type, Any

from bunq.sdk.context.api_environment_type import ApiEnvironmentType
from bunq.sdk.context.installation_context import InstallationContext
from bunq.sdk.http.pagination import Pagination
from bunq.sdk.json import converter
from bunq.sdk.model.core.anchor_object_interface import AnchorObjectInterface
from bunq.sdk.util.type_alias import T

def initialize_converter():
"""
:rtype: None
"""

def initialize_converter() -> None:
import datetime
import inspect

from bunq.sdk import client
from bunq.sdk import context
from bunq.sdk.model import core
from bunq.sdk.json import adapters
from bunq.sdk.http import api_client
from bunq.sdk.context import api_context
from bunq.sdk.json import converter
from bunq.sdk.model.generated import object_
from bunq.sdk.model.generated import endpoint
from bunq.sdk.model.core.installation import Installation
from bunq.sdk.model.core.session_server import SessionServer
from bunq.sdk.json.installation_adapter import InstallationAdapter
from bunq.sdk.json.session_server_adapter import SessionServerAdapter
from bunq.sdk.json.installation_context_adapter import InstallationContextAdapter
from bunq.sdk.json.api_environment_type_adapter import ApiEnvironmentTypeAdapter
from bunq.sdk.json.float_adapter import FloatAdapter
from bunq.sdk.json.geolocation_adapter import GeolocationAdapter
from bunq.sdk.json.monetary_account_reference_adapter import MonetaryAccountReferenceAdapter
from bunq.sdk.json.share_detail_adapter import ShareDetailAdapter
from bunq.sdk.json.date_time_adapter import DateTimeAdapter
from bunq.sdk.json.pagination_adapter import PaginationAdapter
from bunq.sdk.json.anchor_object_adapter import AnchorObjectAdapter

converter.register_adapter(core.Installation, adapters.InstallationAdapter)
converter.register_adapter(
core.SessionServer,
adapters.SessionServerAdapter
)
converter.register_adapter(
context.InstallationContext,
adapters.InstallationContextAdapter
)
converter.register_adapter(
context.ApiEnvironmentType,
adapters.ApiEnvironmentTypeAdapter
)
converter.register_adapter(float, adapters.FloatAdapter)
converter.register_adapter(object_.Geolocation, adapters.GeolocationAdapter)
converter.register_adapter(
object_.MonetaryAccountReference,
adapters.MonetaryAccountReferenceAdapter
)
converter.register_adapter(object_.ShareDetail, adapters.ShareDetailAdapter)
converter.register_adapter(datetime.datetime, adapters.DateTimeAdapter)
converter.register_adapter(client.Pagination, adapters.PaginationAdapter)
converter.register_adapter(Installation, InstallationAdapter)
converter.register_adapter(SessionServer, SessionServerAdapter)
converter.register_adapter(InstallationContext, InstallationContextAdapter)
converter.register_adapter(ApiEnvironmentType, ApiEnvironmentTypeAdapter)
converter.register_adapter(float, FloatAdapter)
converter.register_adapter(object_.Geolocation, GeolocationAdapter)
converter.register_adapter(object_.MonetaryAccountReference, MonetaryAccountReferenceAdapter)
converter.register_adapter(object_.ShareDetail, ShareDetailAdapter)
converter.register_adapter(datetime.datetime, DateTimeAdapter)
converter.register_adapter(Pagination, PaginationAdapter)

def register_anchor_adapter(class_to_regsiter):
if issubclass(class_to_regsiter, core.AnchoredObjectInterface):
converter.register_adapter(
class_to_regsiter,
adapters.AnchoredObjectModelAdapter
)
def register_anchor_adapter(class_to_register: Type[Any]) -> None:
if issubclass(class_to_register, AnchorObjectInterface):
converter.register_adapter(class_to_register, AnchorObjectAdapter)

def get_class(class_string_to_get):
def get_class(class_string_to_get: str) -> Type[Any]:
if hasattr(object_, class_string_to_get):
return getattr(object_, class_string_to_get)

Expand Down
Loading

0 comments on commit f487783

Please sign in to comment.