# Path: ingenico/connect/sdk/defaultimpl/default_marshaller.py
# class DefaultMarshaller(Marshaller):
#     """
#     Marshaller implementation based on json.
#     """
# 
#     @staticmethod
#     def INSTANCE():
#         return _DEFAULT_MARSHALLER_INSTANCE
# 
#     def marshal(self, request_object):
#         if isinstance(request_object, DataObject):
#             dictionary = request_object.to_dictionary()
#             return dumps(dictionary, default=lambda o: o.to_dictionary(),
#                          indent=4)
#         else:
#             return dumps(request_object, default=lambda o: o.__dict__, indent=4)
# 
#     def unmarshal(self, response_json, type_class):
#         if not response_json:
#             return None
#         if issubclass(type_class, DataObject):
#             try:
#                 return type_class().from_dictionary(loads(response_json))
#             except ValueError as e:
#                 raise MarshallerSyntaxException(e)
# 
#         class Object(object):
#             pass
# 
#         def convert_to_object(d):
#             try:
#                 d = dict(d)
#             except (TypeError, ValueError):
#                 return d
#             o = Object()
#             for key, value in d.items():
#                 o.__dict__[key] = convert_to_object(value)
#             return o
# 
#         try:
#             dictionary = loads(response_json)
#             converted_object = convert_to_object(dictionary)
#             return converted_object
#         except ValueError as e:
#             raise MarshallerSyntaxException(e)
# 
# Path: ingenico/connect/sdk/webhooks/web_hooks_helper_builder.py
# class WebhooksHelperBuilder:
#     """
#     Builder for a WebhooksHelper object.
#     """
#     __marshaller = None
#     __secret_key_store = None
# 
#     def with_marshaller(self, marshaller):
#         """
#         Sets the Marshaller to use.
#         """
#         self.__marshaller = marshaller
#         return self
# 
#     def with_secret_key_store(self, secret_key_store):
#         """
#         Sets the SecretKeyStore to use.
#         """
#         self.__secret_key_store = secret_key_store
#         return self
# 
#     def build(self):
#         """
#         Creates a fully initialized WebhooksHelper object.
# 
#         :raise: ValueError: if not all required components are set
#         """
#         return WebhooksHelper(self.__marshaller, self.__secret_key_store)


from ingenico.connect.sdk.defaultimpl.default_marshaller import \
    DefaultMarshaller
from .web_hooks_helper_builder import WebhooksHelperBuilder


class Webhooks:
    """
    Ingenico ePayments platform factory for several webhooks components.
    """

    @staticmethod
    def create_helper_builder(secret_key_store):
        """
        Creates a WebhooksHelperBuilder that will use the given SecretKeyStore.
        """

# Path: ingenico/connect/sdk/defaultimpl/default_marshaller.py
# class DefaultMarshaller(Marshaller):
#     """
#     Marshaller implementation based on json.
#     """
# 
#     @staticmethod
#     def INSTANCE():
#         return _DEFAULT_MARSHALLER_INSTANCE
# 
#     def marshal(self, request_object):
#         if isinstance(request_object, DataObject):
#             dictionary = request_object.to_dictionary()
#             return dumps(dictionary, default=lambda o: o.to_dictionary(),
#                          indent=4)
#         else:
#             return dumps(request_object, default=lambda o: o.__dict__, indent=4)
# 
#     def unmarshal(self, response_json, type_class):
#         if not response_json:
#             return None
#         if issubclass(type_class, DataObject):
#             try:
#                 return type_class().from_dictionary(loads(response_json))
#             except ValueError as e:
#                 raise MarshallerSyntaxException(e)
# 
#         class Object(object):
#             pass
# 
#         def convert_to_object(d):
#             try:
#                 d = dict(d)
#             except (TypeError, ValueError):
#                 return d
#             o = Object()
#             for key, value in d.items():
#                 o.__dict__[key] = convert_to_object(value)
#             return o
# 
#         try:
#             dictionary = loads(response_json)
#             converted_object = convert_to_object(dictionary)
#             return converted_object
#         except ValueError as e:
#             raise MarshallerSyntaxException(e)
# 
# Path: ingenico/connect/sdk/webhooks/web_hooks_helper_builder.py
# class WebhooksHelperBuilder:
#     """
#     Builder for a WebhooksHelper object.
#     """
#     __marshaller = None
#     __secret_key_store = None
# 
#     def with_marshaller(self, marshaller):
#         """
#         Sets the Marshaller to use.
#         """
#         self.__marshaller = marshaller
#         return self
# 
#     def with_secret_key_store(self, secret_key_store):
#         """
#         Sets the SecretKeyStore to use.
#         """
#         self.__secret_key_store = secret_key_store
#         return self
# 
#     def build(self):
#         """
#         Creates a fully initialized WebhooksHelper object.
# 
#         :raise: ValueError: if not all required components are set
#         """
#         return WebhooksHelper(self.__marshaller, self.__secret_key_store)


# Path: ingenico/connect/sdk/webhooks/web_hooks.py
from ingenico.connect.sdk.defaultimpl.default_marshaller import \
    DefaultMarshaller
from .web_hooks_helper_builder import WebhooksHelperBuilder



class Webhooks:
    """
    Ingenico ePayments platform factory for several webhooks components.
    """

    @staticmethod
    def create_helper_builder(secret_key_store):
        """
        Creates a WebhooksHelperBuilder that will use the given SecretKeyStore.
        """

        return WebhooksHelperBuilder().with_marshaller(