Skip to content

Commit a87af49

Browse files
committed
implement ProjectOwner
1 parent d7baa4c commit a87af49

File tree

6 files changed

+47
-10
lines changed

6 files changed

+47
-10
lines changed

github/interfaces/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
from github.interfaces.packageowner import __all__ as _packageowner__all__
2323
from github.interfaces.profileowner import *
2424
from github.interfaces.profileowner import __all__ as _profileowner__all__
25+
from github.interfaces.projectowner import *
26+
from github.interfaces.projectowner import __all__ as _projectowner__all__
2527
from github.interfaces.reactable import *
2628
from github.interfaces.reactable import __all__ as _reactable__all__
2729
from github.interfaces.repositorynode import *
@@ -58,6 +60,7 @@
5860
*_packageowner__all__,
5961
*_repositorynode__all__,
6062
*_profileowner__all__,
63+
*_projectowner__all__,
6164
*_reactable__all__,
6265
*_repositoryowner__all__,
6366
*_resource__all__,

github/interfaces/projectowner.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from __future__ import annotations
2+
from typing import TYPE_CHECKING
3+
4+
5+
if TYPE_CHECKING:
6+
from typing import TypedDict
7+
8+
9+
class ProjectOwnerData(TypedDict):
10+
# id: str # NOTE: on Node
11+
# projectV2 # TODO
12+
# projectsV2 # TODO
13+
pass
14+
15+
16+
class ProjectOwner:
17+
"""
18+
Represents an object that can own a :class:`~github.Project`.
19+
"""
20+
21+
__slots__ = ()
22+
23+
_data: ProjectOwnerData
24+
25+
26+
__all__: list[str] = [
27+
"ProjectOwner",
28+
]

github/organization/organization.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from github.utility.types import DateTime
1515

1616
import github
17-
from github.interfaces import Actor, AnnouncementOwner, DiscussionAuthor, Node, PackageOwner, ProfileOwner, RepositoryOwner, Resource, Sponsorable, Type
17+
from github.interfaces import Actor, AnnouncementOwner, DiscussionAuthor, Node, PackageOwner, ProfileOwner, ProjectOwner, RepositoryOwner, Resource, Sponsorable, Type
1818
from github.utility import MISSING
1919

2020

@@ -29,6 +29,7 @@
2929
from github.interfaces.node import NodeData
3030
from github.interfaces.packageowner import PackageOwnerData
3131
from github.interfaces.profileowner import ProfileOwnerData
32+
from github.interfaces.projectowner import ProjectOwnerData
3233
from github.interfaces.repositoryowner import RepositoryOwnerData
3334
from github.interfaces.resource import ResourceData
3435
from github.interfaces.sponsorable import SponsorableData
@@ -44,7 +45,7 @@ class OrganizationData(
4445
NodeData,
4546
PackageOwnerData,
4647
ProfileOwnerData,
47-
# ProjectOwnerData, # TODO
48+
ProjectOwnerData,
4849
RepositoryOwnerData,
4950
ResourceData,
5051
SponsorableData,
@@ -99,7 +100,7 @@ class Organization(
99100
Node,
100101
PackageOwner,
101102
ProfileOwner,
102-
# ProjectOwner, # TODO
103+
ProjectOwner,
103104
RepositoryOwner,
104105
Resource,
105106
Sponsorable,

github/repository/issue.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from github.user.user import UserData
1212

1313
import github
14-
from github.interfaces import Assignable, Closable, Comment, Deletable, Labelable, Lockable, Node, Reactable, RepositoryNode, Resource, Subscribable, Type, Updatable
14+
from github.interfaces import Assignable, Closable, Comment, Deletable, Labelable, Lockable, Node, ProjectOwner, Reactable, RepositoryNode, Resource, Subscribable, Type, Updatable
1515
from github.utility import MISSING
1616

1717

@@ -26,6 +26,7 @@
2626
from github.interfaces.labelable import LabelableData
2727
from github.interfaces.lockable import LockableData
2828
from github.interfaces.node import NodeData
29+
from github.interfaces.projectowner import ProjectOwnerData
2930
from github.interfaces.reactable import ReactableData
3031
from github.interfaces.repositorynode import RepositoryNodeData
3132
from github.interfaces.resource import ResourceData
@@ -45,7 +46,7 @@ class IssueData(
4546
LabelableData,
4647
LockableData,
4748
NodeData,
48-
# ProjectOwnerData, # TODO
49+
ProjectOwnerData,
4950
ReactableData,
5051
RepositoryNodeData,
5152
ResourceData,
@@ -89,6 +90,7 @@ class Issue(
8990
Labelable,
9091
Lockable,
9192
Node,
93+
ProjectOwner,
9294
Reactable,
9395
RepositoryNode,
9496
Resource,

github/repository/pull.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from github.utility.types import DateTime
1313

1414
import github
15-
from github.interfaces import Assignable, Closable, Comment, Labelable, Lockable, Node, Reactable, RepositoryNode, Resource, Type, Subscribable, Updatable
15+
from github.interfaces import Assignable, Closable, Comment, Labelable, Lockable, Node, ProjectOwner, Reactable, RepositoryNode, Resource, Type, Subscribable, Updatable
1616
from github.utility import MISSING
1717

1818

@@ -28,6 +28,7 @@
2828
from github.interfaces.labelable import LabelableData
2929
from github.interfaces.lockable import LockableData
3030
from github.interfaces.node import NodeData
31+
from github.interfaces.projectowner import ProjectOwnerData
3132
from github.interfaces.reactable import ReactableData
3233
from github.interfaces.repositorynode import RepositoryNodeData
3334
from github.interfaces.resource import ResourceData
@@ -49,7 +50,7 @@ class PullData(
4950
LabelableData,
5051
LockableData,
5152
NodeData,
52-
# ProjectOwnerData, # TODO
53+
ProjectOwnerData,
5354
ReactableData,
5455
RepositoryNodeData,
5556
ResourceData,
@@ -133,6 +134,7 @@ class Pull(
133134
Labelable,
134135
Lockable,
135136
Node,
137+
ProjectOwner,
136138
Reactable,
137139
RepositoryNode,
138140
Resource,

github/user/user.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from github.utility.types import DateTime
1717

1818
import github
19-
from github.interfaces import Actor, DiscussionAuthor, Node, PackageOwner, ProfileOwner, RepositoryOwner, Resource, Sponsorable, Type
19+
from github.interfaces import Actor, DiscussionAuthor, Node, PackageOwner, ProfileOwner, ProjectOwner, RepositoryOwner, Resource, Sponsorable, Type
2020
from github.utility import MISSING
2121

2222

@@ -29,6 +29,7 @@
2929
from github.interfaces.node import NodeData
3030
from github.interfaces.packageowner import PackageOwnerData
3131
from github.interfaces.profileowner import ProfileOwnerData
32+
from github.interfaces.projectowner import ProjectOwnerData
3233
from github.interfaces.repositoryowner import RepositoryOwnerData
3334
from github.interfaces.resource import ResourceData
3435
from github.interfaces.sponsorable import SponsorableData
@@ -41,7 +42,7 @@ class UserData(
4142
NodeData,
4243
PackageOwnerData,
4344
ProfileOwnerData,
44-
# ProjectOwnerData, # TODO (support-projects): GitHub Projects support
45+
ProjectOwnerData,
4546
RepositoryOwnerData,
4647
ResourceData,
4748
SponsorableData,
@@ -108,7 +109,7 @@ class User(
108109
Node,
109110
PackageOwner,
110111
ProfileOwner,
111-
# ProjectOwner, # TODO (support-projects): GitHub Projects support
112+
ProjectOwner,
112113
RepositoryOwner,
113114
Sponsorable,
114115
Type,

0 commit comments

Comments
 (0)