Skip to content

Commit

Permalink
core.Request: Add from_api() class method
Browse files Browse the repository at this point in the history
  • Loading branch information
dmach committed Feb 14, 2023
1 parent 09ad87c commit 17e2577
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions osc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2967,6 +2967,12 @@ def from_xml(action_node):
class Request:
"""Represents a request (``<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()

Expand Down

0 comments on commit 17e2577

Please sign in to comment.