API Documentation ----------------- The documentation for the SwiftyRx can be found at https://acme.swiftyrx.dev/api/ui/ Client Installation ------------------- The Python clients are pushed to PyPi and can be installed with the following references: "rxfoundry.clients.swifty-oauth-api" = ">=0.0.{version}" "rxfoundry.clients.swifty_api" = ">=0.0.{version}" Where `{version}` corresponds to the last segment of the version shown in the upper left corner of the API documentation. See the following for more details on the install packages: * https://pypi.org/project/rxfoundry.clients.swifty-api/ * https://pypi.org/project/rxfoundry.clients.swifty-oauth-api/ Example Usage ------------- Authorization ~~~~~~~~~~~~~ .. code-block:: python :linenos: :caption: get_token_example.py import rxfoundry.clients.swifty_oauth_api from rxfoundry.clients.swifty_oauth_api import TokenResponse, UserInfoResponse from rxfoundry.clients.swifty_oauth_api.rest import ApiException def get_auth_tokens(host: str, username: str, password: str) -> TokenResponse | None: configuration = rxfoundry.clients.swifty_oauth_api.Configuration(host=host) with rxfoundry.clients.swifty_oauth_api.ApiClient(configuration) as api_client: api_instance = rxfoundry.clients.swifty_oauth_api.OAuthApi(api_client) get_token_request = rxfoundry.clients.swifty_oauth_api.GetTokenRequest( grant_type="password", username=username, password=password ) try: api_response = api_instance.get_token(get_token_request) return api_response except ApiException as e: print("Exception when calling DefaultApi->get_token: %s\n" % e) User Information ~~~~~~~~~~~~~~~~ .. code-block:: python :linenos: :caption: get_userinfo_example.py import rxfoundry.clients.swifty_oauth_api from rxfoundry.clients.swifty_oauth_api import TokenResponse, UserInfoResponse from rxfoundry.clients.swifty_oauth_api.rest import ApiException configuration = rxfoundry.clients.swifty_oauth_api.Configuration(host=host) with rxfoundry.clients.swifty_oauth_api.ApiClient(configuration) as api_client: api_instance = rxfoundry.clients.swifty_oauth_api.OAuthApi(api_client) try: api_response = api_instance.get_user_info( _headers={"Authorization": f"Bearer {token}"} ) return api_response except ApiException as e: print("Exception when calling DefaultApi->get_user_info: %s\n" % e) Full Example ~~~~~~~~~~~~ A more complete example of using the Python SDK can be found on `Github `_