foundry_dev_tools.clients.api_client module#

API client parent class.

class foundry_dev_tools.clients.api_client.APIClient[source]#

Bases: object

Base class for API clients.

api_name: ClassVar[str]#
__init__(context)[source]#
Parameters:

context (FoundryContext)

Return type:

None

api_url(api_path)[source]#

Returns the API URL for the specified parameters.

Parameters:

api_path (str)

Return type:

str

api_request(method, api_path, params=None, data=None, headers=None, cookies=None, files=None, auth=None, timeout=None, allow_redirects=True, proxies=None, hooks=None, stream=None, verify=None, cert=None, json=None, error_handling=None)[source]#

Make an authenticated request to the Foundry API.

The api_path argument is only the api path and not the full URL. For https://foundry/example/api/method/… this would be only, “method/…”.

Parameters:
Return type:

Response

class foundry_dev_tools.clients.api_client.PublicAPIClient[source]#

Bases: object

API client base class for the publicly documented API.

api_name: ClassVar[str]#
__init__(context)[source]#
Parameters:

context (FoundryContext)

Return type:

None

api_url(api_path=None, version='v1')[source]#

Returns the API URL for the specified parameters.

Parameters:
  • api_path (str | None) – the part after /api/{version}/{api_name}/

  • version (str) – the API endpoint version

Return type:

str

api_request(method, api_path=None, api_version='v1', api_preview=False, params=None, data=None, headers=None, cookies=None, files=None, auth=None, timeout=None, allow_redirects=True, proxies=None, hooks=None, stream=None, verify=None, cert=None, json=None, error_handling=None)[source]#

Make an authenticated request to the Foundry API.

The api_path argument is only the api path and not the full URL. For https://foundry/example/api/method/… this would be only, “method/…”.

Parameters:
Return type:

Response