From 17e25776a2f63a5caaadef14511b64eafafc1fc6 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Fri, 10 Feb 2023 11:04:34 +0100 Subject: [PATCH] core.Request: Add from_api() class method --- osc/core.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osc/core.py b/osc/core.py index 62f401bc57..da5ee20a44 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2967,6 +2967,12 @@ def from_xml(action_node): class Request: """Represents a request (````)""" + @classmethod + def from_api(cls, apiurl: str, req_id: int): + # TODO: deprecate get_request() or move its content here + req_id = str(req_id) + return get_request(apiurl, req_id) + def __init__(self): self._init_attributes()