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.
- __init__(context)[source]#
- Parameters:
context (FoundryContext)
- Return type:
None
- 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:
method (str | bytes) – see
requests.Session.request()
api_path (str) – only the api path
params (_Params | None) – see
requests.Session.request()
data (_Data | None) – see
requests.Session.request()
headers (dict | None) – see
requests.Session.request()
, content-type defaults to application/json if not setcookies (RequestsCookieJar | _TextMapping | None) – see
requests.Session.request()
files (_Files | None) – see
requests.Session.request()
auth (_Auth | None) – see
foundry_dev_tools.clients.context_client.ContextHTTPClient.auth_handler()
timeout (_Timeout | None) – see
requests.Session.request()
allow_redirects (bool) – see
requests.Session.request()
proxies (_TextMapping | None) – see
requests.Session.request()
hooks (_HooksInput | None) – see
requests.Session.request()
stream (bool | None) – see
requests.Session.request()
verify (_Verify | None) – see
requests.Session.request()
cert (_Cert | None) – see
requests.Session.request()
json (Incomplete | None) – see
requests.Session.request()
error_handling (ErrorHandlingConfig | Literal[False] | None) – error handling config; if set to False, errors won’t be automatically handled
- Return type:
Response
- class foundry_dev_tools.clients.api_client.PublicAPIClient[source]#
Bases:
object
API client base class for the publicly documented API.
- __init__(context)[source]#
- Parameters:
context (FoundryContext)
- Return type:
None
- 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:
method (str | bytes) – see
requests.Session.request()
api_path (str | None) – only the api path
api_version (str) – the version of the API endpoint /api/{version}/{api_name}
api_preview (bool) – set to true if the api_endpoint is in public preview https://www.palantir.com/docs/foundry/api/general/overview/versioning/#public-preview
params (_Params | None) – see
requests.Session.request()
data (_Data | None) – see
requests.Session.request()
headers (dict | None) – see
requests.Session.request()
, content-type defaults to application/json if not setcookies (RequestsCookieJar | _TextMapping | None) – see
requests.Session.request()
files (_Files | None) – see
requests.Session.request()
auth (_Auth | None) – see
foundry_dev_tools.clients.context_client.ContextHTTPClient.auth_handler()
timeout (_Timeout | None) – see
requests.Session.request()
allow_redirects (bool) – see
requests.Session.request()
proxies (_TextMapping | None) – see
requests.Session.request()
hooks (_HooksInput | None) – see
requests.Session.request()
stream (bool | None) – see
requests.Session.request()
verify (_Verify | None) – see
requests.Session.request()
cert (_Cert | None) – see
requests.Session.request()
json (Incomplete | None) – see
requests.Session.request()
error_handling (ErrorHandlingConfig | Literal[False] | None) – error handling config; if set to False, errors won’t be automatically handled
- Return type:
Response