Skip to content

Commit

Permalink
implement ProjectOwner
Browse files Browse the repository at this point in the history
  • Loading branch information
ShineyDev committed Jan 9, 2025
1 parent d7baa4c commit a87af49
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 10 deletions.
3 changes: 3 additions & 0 deletions github/interfaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from github.interfaces.packageowner import __all__ as _packageowner__all__
from github.interfaces.profileowner import *
from github.interfaces.profileowner import __all__ as _profileowner__all__
from github.interfaces.projectowner import *
from github.interfaces.projectowner import __all__ as _projectowner__all__
from github.interfaces.reactable import *
from github.interfaces.reactable import __all__ as _reactable__all__
from github.interfaces.repositorynode import *
Expand Down Expand Up @@ -58,6 +60,7 @@
*_packageowner__all__,
*_repositorynode__all__,
*_profileowner__all__,
*_projectowner__all__,
*_reactable__all__,
*_repositoryowner__all__,
*_resource__all__,
Expand Down
28 changes: 28 additions & 0 deletions github/interfaces/projectowner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from __future__ import annotations
from typing import TYPE_CHECKING


if TYPE_CHECKING:
from typing import TypedDict


class ProjectOwnerData(TypedDict):
# id: str # NOTE: on Node
# projectV2 # TODO
# projectsV2 # TODO
pass


class ProjectOwner:
"""
Represents an object that can own a :class:`~github.Project`.
"""

__slots__ = ()

_data: ProjectOwnerData


__all__: list[str] = [
"ProjectOwner",
]
7 changes: 4 additions & 3 deletions github/organization/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from github.utility.types import DateTime

import github
from github.interfaces import Actor, AnnouncementOwner, DiscussionAuthor, Node, PackageOwner, ProfileOwner, RepositoryOwner, Resource, Sponsorable, Type
from github.interfaces import Actor, AnnouncementOwner, DiscussionAuthor, Node, PackageOwner, ProfileOwner, ProjectOwner, RepositoryOwner, Resource, Sponsorable, Type
from github.utility import MISSING


Expand All @@ -29,6 +29,7 @@
from github.interfaces.node import NodeData
from github.interfaces.packageowner import PackageOwnerData
from github.interfaces.profileowner import ProfileOwnerData
from github.interfaces.projectowner import ProjectOwnerData
from github.interfaces.repositoryowner import RepositoryOwnerData
from github.interfaces.resource import ResourceData
from github.interfaces.sponsorable import SponsorableData
Expand All @@ -44,7 +45,7 @@ class OrganizationData(
NodeData,
PackageOwnerData,
ProfileOwnerData,
# ProjectOwnerData, # TODO
ProjectOwnerData,
RepositoryOwnerData,
ResourceData,
SponsorableData,
Expand Down Expand Up @@ -99,7 +100,7 @@ class Organization(
Node,
PackageOwner,
ProfileOwner,
# ProjectOwner, # TODO
ProjectOwner,
RepositoryOwner,
Resource,
Sponsorable,
Expand Down
6 changes: 4 additions & 2 deletions github/repository/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from github.user.user import UserData

import github
from github.interfaces import Assignable, Closable, Comment, Deletable, Labelable, Lockable, Node, Reactable, RepositoryNode, Resource, Subscribable, Type, Updatable
from github.interfaces import Assignable, Closable, Comment, Deletable, Labelable, Lockable, Node, ProjectOwner, Reactable, RepositoryNode, Resource, Subscribable, Type, Updatable
from github.utility import MISSING


Expand All @@ -26,6 +26,7 @@
from github.interfaces.labelable import LabelableData
from github.interfaces.lockable import LockableData
from github.interfaces.node import NodeData
from github.interfaces.projectowner import ProjectOwnerData
from github.interfaces.reactable import ReactableData
from github.interfaces.repositorynode import RepositoryNodeData
from github.interfaces.resource import ResourceData
Expand All @@ -45,7 +46,7 @@ class IssueData(
LabelableData,
LockableData,
NodeData,
# ProjectOwnerData, # TODO
ProjectOwnerData,
ReactableData,
RepositoryNodeData,
ResourceData,
Expand Down Expand Up @@ -89,6 +90,7 @@ class Issue(
Labelable,
Lockable,
Node,
ProjectOwner,
Reactable,
RepositoryNode,
Resource,
Expand Down
6 changes: 4 additions & 2 deletions github/repository/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from github.utility.types import DateTime

import github
from github.interfaces import Assignable, Closable, Comment, Labelable, Lockable, Node, Reactable, RepositoryNode, Resource, Type, Subscribable, Updatable
from github.interfaces import Assignable, Closable, Comment, Labelable, Lockable, Node, ProjectOwner, Reactable, RepositoryNode, Resource, Type, Subscribable, Updatable
from github.utility import MISSING


Expand All @@ -28,6 +28,7 @@
from github.interfaces.labelable import LabelableData
from github.interfaces.lockable import LockableData
from github.interfaces.node import NodeData
from github.interfaces.projectowner import ProjectOwnerData
from github.interfaces.reactable import ReactableData
from github.interfaces.repositorynode import RepositoryNodeData
from github.interfaces.resource import ResourceData
Expand All @@ -49,7 +50,7 @@ class PullData(
LabelableData,
LockableData,
NodeData,
# ProjectOwnerData, # TODO
ProjectOwnerData,
ReactableData,
RepositoryNodeData,
ResourceData,
Expand Down Expand Up @@ -133,6 +134,7 @@ class Pull(
Labelable,
Lockable,
Node,
ProjectOwner,
Reactable,
RepositoryNode,
Resource,
Expand Down
7 changes: 4 additions & 3 deletions github/user/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from github.utility.types import DateTime

import github
from github.interfaces import Actor, DiscussionAuthor, Node, PackageOwner, ProfileOwner, RepositoryOwner, Resource, Sponsorable, Type
from github.interfaces import Actor, DiscussionAuthor, Node, PackageOwner, ProfileOwner, ProjectOwner, RepositoryOwner, Resource, Sponsorable, Type
from github.utility import MISSING


Expand All @@ -29,6 +29,7 @@
from github.interfaces.node import NodeData
from github.interfaces.packageowner import PackageOwnerData
from github.interfaces.profileowner import ProfileOwnerData
from github.interfaces.projectowner import ProjectOwnerData
from github.interfaces.repositoryowner import RepositoryOwnerData
from github.interfaces.resource import ResourceData
from github.interfaces.sponsorable import SponsorableData
Expand All @@ -41,7 +42,7 @@ class UserData(
NodeData,
PackageOwnerData,
ProfileOwnerData,
# ProjectOwnerData, # TODO (support-projects): GitHub Projects support
ProjectOwnerData,
RepositoryOwnerData,
ResourceData,
SponsorableData,
Expand Down Expand Up @@ -108,7 +109,7 @@ class User(
Node,
PackageOwner,
ProfileOwner,
# ProjectOwner, # TODO (support-projects): GitHub Projects support
ProjectOwner,
RepositoryOwner,
Sponsorable,
Type,
Expand Down

0 comments on commit a87af49

Please sign in to comment.