Skip to content

Easy to use facades for the Connect Open API.

License

Notifications You must be signed in to change notification settings

IM-Cloud-Spain-Connectors/python-connect-api-facades

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Connect API Facades

Test

Easy to use facades for the Connect Open API.

Installation

The easiest way to install the Connect API Facades library is to get the latest version from PyPI:

# using poetry
poetry add rndi-connect-api-facades
# using pip
pip install rndi-connect-api-facades

The Contracts

This package provides the following contracts or interfaces:

  • AssetManagementService

The Adapters

The facade works as the adapter for the interfaces, it also adds new functionality to enhance the experience, to use it, just instantiate the ConnectOpenAPIFacade injecting an API instance.

from rndi.connect.api_facades.facade import ConnectOpenAPIFacade

api = ConnectOpenAPIFacade(client)
api.find_asset('AS-XXXX-XXXX-XXXX')

Optionally, you can import and use standalone mixing facades for each API endpoint:

from rndi.connect.api_facades.assets.mixins import WithAssetFacade


class MyCustomClass(WithAssetFacade):
    def __init__(self, client):
        self.client = client


api = MyCustomClass(client)
api.find_asset('AS-XXXX-XXXX-XXXX')