Add name, display_title and path attributes to WorkflowRun (#2397)

This commit is contained in:
Sasha Chung
2023-06-01 10:41:33 +02:00
committed by GitHub
parent f82ad61c37
commit 10816389d2
9 changed files with 148 additions and 56 deletions
+33
View File
@@ -44,6 +44,14 @@ class WorkflowRun(github.GithubObject.CompletableGithubObject):
self._completeIfNotSet(self._id)
return self._id.value
@property
def name(self):
"""
:type: string
"""
self._completeIfNotSet(self._name)
return self._name.value
@property
def head_branch(self):
"""
@@ -60,6 +68,22 @@ class WorkflowRun(github.GithubObject.CompletableGithubObject):
self._completeIfNotSet(self._head_sha)
return self._head_sha.value
@property
def display_title(self):
"""
:type: string
"""
self._completeIfNotSet(self._display_title)
return self._display_title.value
@property
def path(self):
"""
:type: string
"""
self._completeIfNotSet(self._path)
return self._path.value
@property
def run_attempt(self):
"""
@@ -280,8 +304,11 @@ class WorkflowRun(github.GithubObject.CompletableGithubObject):
def _initAttributes(self):
self._id = github.GithubObject.NotSet
self._name = github.GithubObject.NotSet
self._head_branch = github.GithubObject.NotSet
self._head_sha = github.GithubObject.NotSet
self._display_title = github.GithubObject.NotSet
self._path = github.GithubObject.NotSet
self._run_attempt = github.GithubObject.NotSet
self._run_number = github.GithubObject.NotSet
self._event = github.GithubObject.NotSet
@@ -308,10 +335,16 @@ class WorkflowRun(github.GithubObject.CompletableGithubObject):
def _useAttributes(self, attributes):
if "id" in attributes: # pragma no branch
self._id = self._makeIntAttribute(attributes["id"])
if "name" in attributes: # pragma no branch
self._name = self._makeStringAttribute(attributes["name"])
if "head_branch" in attributes: # pragma no branch
self._head_branch = self._makeStringAttribute(attributes["head_branch"])
if "head_sha" in attributes: # pragma no branch
self._head_sha = self._makeStringAttribute(attributes["head_sha"])
if "display_title" in attributes: # pragma no branch
self._display_title = self._makeStringAttribute(attributes["display_title"])
if "path" in attributes: # pragma no branch
self._path = self._makeStringAttribute(attributes["path"])
if "run_attempt" in attributes: # pragma no branch
self._run_attempt = self._makeIntAttribute(attributes["run_attempt"])
if "run_number" in attributes: # pragma no branch
+10
View File
@@ -17,12 +17,22 @@ class WorkflowRun(CompletableGithubObject):
@property
def id(self) -> int: ...
@property
def name(self) -> str: ...
@property
def head_branch(self) -> str: ...
@property
def head_sha(self) -> str: ...
@property
def path(self) -> str: ...
@property
def display_title(self) -> str: ...
@property
def run_number(self) -> int: ...
@property
def run_attempt(self) -> int: ...
@property
def run_started_at(self) -> str: ...
@property
def event(self) -> str: ...
@property
def status(self) -> str: ...