Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/types for repo topic team #2341

Merged
merged 4 commits into from Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 19 additions & 5 deletions github/Repository.pyi
Expand Up @@ -106,8 +106,8 @@ class Repository(CompletableGithubObject):
def contributors_url(self) -> str: ...
def create_check_run(
self,
name: str = ...,
head_sha: str = ...,
name: str,
head_sha: str,
details_url: Union[_NotSetType, str] = ...,
external_id: Union[_NotSetType, str] = ...,
status: Union[_NotSetType, str] = ...,
Expand Down Expand Up @@ -214,7 +214,9 @@ class Repository(CompletableGithubObject):
description: Union[str, _NotSetType] = ...,
due_on: Union[date, _NotSetType] = ...,
) -> Milestone: ...
def create_project(self, name: str, body: str = ...) -> Project: ...
def create_project(
self, name: str, body: Union[str, _NotSetType] = ...
) -> Project: ...
@overload
def create_pull(
self,
Expand All @@ -237,7 +239,7 @@ class Repository(CompletableGithubObject):
issue: Issue,
) -> PullRequest: ...
def create_repository_dispatch(
self, event_type: str, client_payload: Dict[str, Any]
self, event_type: str, client_payload: Union[Dict[str, Any], _NotSetType] = ...
) -> bool: ...
def create_secret(self, secret_name: str, unencrypted_value: str) -> bool: ...
def delete_secret(self, secret_name: str) -> bool: ...
Expand Down Expand Up @@ -466,7 +468,13 @@ class Repository(CompletableGithubObject):
def get_workflow(self, id_or_name: Union[str, int]) -> Workflow: ...
def get_workflows(self) -> PaginatedList[Workflow]: ...
def get_workflow_run(self, id_: int) -> WorkflowRun: ...
def get_workflow_runs(self) -> PaginatedList[WorkflowRun]: ...
def get_workflow_runs(
self,
actor: Union[NamedUser, _NotSetType] = ...,
branch: Union[Branch, _NotSetType] = ...,
event: Union[str, _NotSetType] = ...,
status: Union[str, _NotSetType] = ...,
) -> PaginatedList[WorkflowRun]: ...
def update_check_suites_preferences(
self, auto_trigger_checks: List[Dict[str, Union[bool, int]]]
) -> RepositoryPreferences: ...
Expand Down Expand Up @@ -499,6 +507,8 @@ class Repository(CompletableGithubObject):
@property
def id(self) -> int: ...
@property
def is_template(self) -> bool: ...
@property
def issue_comment_url(self) -> str: ...
@property
def issue_events_url(self) -> str: ...
Expand Down Expand Up @@ -587,6 +597,8 @@ class Repository(CompletableGithubObject):
@property
def teams_url(self) -> str: ...
@property
def topics(self) -> List[str]: ...
@property
def trees_url(self) -> str: ...
def unsubscribe_from_hub(self, event: str, callback: str) -> None: ...
def update_file(
Expand All @@ -604,6 +616,8 @@ class Repository(CompletableGithubObject):
@property
def url(self) -> str: ...
@property
def visibility(self) -> str: ...
@property
def watchers(self) -> int: ...
@property
def watchers_count(self) -> int: ...
8 changes: 8 additions & 0 deletions github/Team.pyi
Expand Up @@ -5,6 +5,7 @@ from github.NamedUser import NamedUser
from github.Organization import Organization
from github.Membership import Membership
from github.PaginatedList import PaginatedList
from github.Permissions import Permissions
from github.Repository import Repository
from github.TeamDiscussion import TeamDiscussion

Expand All @@ -20,6 +21,10 @@ class Team(CompletableGithubObject):
def add_to_members(self, member: NamedUser) -> None: ...
def get_team_membership(self, member: Union[str, NamedUser]) -> Membership: ...
def add_to_repos(self, repo: Repository) -> None: ...
def get_repo_permission(
self, repo: Repository
) -> Union[Permissions, _NotSetType]: ...
def update_team_repository(self, repo: Repository, permission: str) -> bool: ...
def delete(self) -> None: ...
@property
def description(self) -> str: ...
Expand All @@ -30,6 +35,7 @@ class Team(CompletableGithubObject):
permission: Union[str, _NotSetType] = ...,
privacy: Union[str, _NotSetType] = ...,
) -> None: ...
def get_teams(self) -> PaginatedList[Team]: ...
def get_discussions(self) -> PaginatedList[TeamDiscussion]: ...
def get_members(
self, role: Union[str, _NotSetType] = ...
Expand Down Expand Up @@ -65,4 +71,6 @@ class Team(CompletableGithubObject):
@property
def url(self) -> str: ...
@property
def parent(self) -> Union[Team, _NotSetType]: ...
@property
def html_url(self) -> str: ...
22 changes: 19 additions & 3 deletions github/Topic.pyi
@@ -1,3 +1,5 @@
import datetime

from typing import Any, Dict

from github.GithubObject import NonCompletableGithubObject
Expand All @@ -7,10 +9,24 @@ class Topic(NonCompletableGithubObject):
def _initAttributes(self) -> None: ...
def _useAttributes(self, attributes: Dict[str, Any]) -> None: ...
@property
def description(self) -> str: ...
def name(self) -> str: ...
@property
def display_name(self) -> str: ...
@property
def name(self) -> str: ...
@property
def short_description(self) -> str: ...
@property
def description(self) -> str: ...
@property
def created_by(self) -> str: ...
@property
def released(self) -> str: ...
@property
def created_at(self) -> datetime.datetime: ...
@property
def updated_at(self) -> datetime.datetime: ...
@property
def featured(self) -> bool: ...
@property
def curated(self) -> bool: ...
@property
def score(self) -> float: ...