HTTP Clients
JiraTUI Async HTTP Client
- class JiraTUIAsyncHTTPClient(base_url: str, api_username: str, api_token: str, configuration: jiratui.config.ApplicationConfiguration)
An async HTTP client for the Jira RETS API.
This is useful for operations in endpoints that do not return JSON data, e.g. for downloading file attachments.
Initialization
- async make_request(method: Callable, url: str, headers: dict | None = None, timeout: int = 55, **kwargs) Any | None
Makes a request to the Jira REST API.
- Parameters:
method – the HTTP method to execute.
url – the (relative) URL to request.
headers – any HTTP headers.
timeout – an optional timeout (in seconds). Default is 55. **kwargs: arguments passed directly to the callable method.
- Returns:
The parsed JSON response from the API, or None/empty dict for empty responses.
- Raises:
ServiceInvalidRequestException – If the request fails.
ServiceUnavailableException – If the service is unavailable or times out.
ResourceNotFoundException – If the requested resource is not found (404).
AuthorizationException – If authentication fails (401).
PermissionException – If permission is denied (403).
ServiceInvalidResponseException – If the response cannot be parsed.
JiraClient
- class JiraClient(base_url: str, api_username: str, api_token: str, configuration: jiratui.config.ApplicationConfiguration)
A sync JSON client for the Jira REST API.
This is useful for endpoints that support JSON but do not support async operations, e.g. uploading file attachments.
Initialization
AsyncJiraClient
- class AsyncJiraClient(base_url: str, api_username: str, api_token: str, configuration: jiratui.config.ApplicationConfiguration)
Bases:
jiratui.api.client.JiraTUIAsyncHTTPClientAsync JSON client for the Jira REST API.
Initialization