Skip to content

Commit

Permalink
👽 re-generate models from openapi schema
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Jul 13, 2024
1 parent fd6e9a4 commit 8f41ba1
Show file tree
Hide file tree
Showing 4,413 changed files with 245,516 additions and 235,552 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
242 changes: 233 additions & 9 deletions githubkit/rest/__init__.py

Large diffs are not rendered by default.

8,910 changes: 4,570 additions & 4,340 deletions githubkit/versions/ghec_v2022_11_28/models/__init__.py

Large diffs are not rendered by default.

105 changes: 24 additions & 81 deletions githubkit/versions/ghec_v2022_11_28/models/group_0047.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,102 +9,45 @@

from __future__ import annotations

from datetime import date
from typing import List, Union
from typing import Union

from pydantic import Field

from githubkit.utils import UNSET
from githubkit.typing import Missing
from githubkit.compat import GitHubModel, ExtraGitHubModel, model_rebuild
from githubkit.compat import GitHubModel, model_rebuild


class CopilotUsageMetrics(GitHubModel):
"""Copilot Usage Metrics
class TeamSimple(GitHubModel):
"""Team Simple
Summary of Copilot usage.
Groups of organization members that gives permissions on specified repositories.
"""

day: date = Field(
description="The date for which the usage metrics are reported, in `YYYY-MM-DD` format."
id: int = Field(description="Unique identifier of the team")
node_id: str = Field()
url: str = Field(description="URL for the team")
members_url: str = Field()
name: str = Field(description="Name of the team")
description: Union[str, None] = Field(description="Description of the team")
permission: str = Field(
description="Permission that the team will have for its repositories"
)
total_suggestions_count: Missing[int] = Field(
default=UNSET,
description="The total number of Copilot code completion suggestions shown to users.",
)
total_acceptances_count: Missing[int] = Field(
default=UNSET,
description="The total number of Copilot code completion suggestions accepted by users.",
)
total_lines_suggested: Missing[int] = Field(
default=UNSET,
description="The total number of lines of code completions suggested by Copilot.",
)
total_lines_accepted: Missing[int] = Field(
default=UNSET,
description="The total number of lines of code completions accepted by users.",
)
total_active_users: Missing[int] = Field(
default=UNSET,
description="The total number of users who were shown Copilot code completion suggestions during the day specified.",
)
total_chat_acceptances: Missing[int] = Field(
default=UNSET,
description="The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline).",
)
total_chat_turns: Missing[int] = Field(
default=UNSET,
description="The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE.",
)
total_active_chat_users: Missing[int] = Field(
default=UNSET,
description="The total number of users who interacted with Copilot Chat in the IDE during the day specified.",
)
breakdown: Union[List[CopilotUsageMetricsPropBreakdownItems], None] = Field(
description="Breakdown of Copilot code completions usage by language and editor"
privacy: Missing[str] = Field(
default=UNSET, description="The level of privacy this team should have"
)


class CopilotUsageMetricsPropBreakdownItems(ExtraGitHubModel):
"""CopilotUsageMetricsPropBreakdownItems
Breakdown of Copilot usage by editor for this language
"""

language: Missing[str] = Field(
default=UNSET,
description="The language in which Copilot suggestions were shown to users in the specified editor.",
)
editor: Missing[str] = Field(
default=UNSET,
description="The editor in which Copilot suggestions were shown to users for the specified language.",
)
suggestions_count: Missing[int] = Field(
default=UNSET,
description="The number of Copilot suggestions shown to users in the editor specified during the day specified.",
)
acceptances_count: Missing[int] = Field(
default=UNSET,
description="The number of Copilot suggestions accepted by users in the editor specified during the day specified.",
)
lines_suggested: Missing[int] = Field(
default=UNSET,
description="The number of lines of code suggested by Copilot in the editor specified during the day specified.",
)
lines_accepted: Missing[int] = Field(
default=UNSET,
description="The number of lines of code accepted by users in the editor specified during the day specified.",
notification_setting: Missing[str] = Field(
default=UNSET, description="The notification setting the team has set"
)
active_users: Missing[int] = Field(
html_url: str = Field()
repositories_url: str = Field()
slug: str = Field()
ldap_dn: Missing[str] = Field(
default=UNSET,
description="The number of users who were shown Copilot completion suggestions in the editor specified during the day specified.",
description="Distinguished Name (DN) that team maps to within LDAP environment",
)


model_rebuild(CopilotUsageMetrics)
model_rebuild(CopilotUsageMetricsPropBreakdownItems)
model_rebuild(TeamSimple)

__all__ = (
"CopilotUsageMetrics",
"CopilotUsageMetricsPropBreakdownItems",
)
__all__ = ("TeamSimple",)
54 changes: 42 additions & 12 deletions githubkit/versions/ghec_v2022_11_28/models/group_0048.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,53 @@

from __future__ import annotations

from typing import Union

from pydantic import Field

from githubkit.utils import UNSET
from githubkit.typing import Missing
from githubkit.compat import GitHubModel, model_rebuild

from .group_0047 import TeamSimple

class DependabotAlertPackage(GitHubModel):
"""DependabotAlertPackage
Details for the vulnerable package.
"""

ecosystem: str = Field(
description="The package's language or package management ecosystem."
)
name: str = Field(description="The unique package name within its ecosystem.")
class Team(GitHubModel):
"""Team
Groups of organization members that gives permissions on specified repositories.
"""

model_rebuild(DependabotAlertPackage)

__all__ = ("DependabotAlertPackage",)
id: int = Field()
node_id: str = Field()
name: str = Field()
slug: str = Field()
description: Union[str, None] = Field()
privacy: Missing[str] = Field(default=UNSET)
notification_setting: Missing[str] = Field(default=UNSET)
permission: str = Field()
permissions: Missing[TeamPropPermissions] = Field(default=UNSET)
url: str = Field()
html_url: str = Field()
members_url: str = Field()
repositories_url: str = Field()
parent: Union[None, TeamSimple] = Field()


class TeamPropPermissions(GitHubModel):
"""TeamPropPermissions"""

pull: bool = Field()
triage: bool = Field()
push: bool = Field()
maintain: bool = Field()
admin: bool = Field()


model_rebuild(Team)
model_rebuild(TeamPropPermissions)

__all__ = (
"Team",
"TeamPropPermissions",
)
141 changes: 117 additions & 24 deletions githubkit/versions/ghec_v2022_11_28/models/group_0049.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,145 @@

from __future__ import annotations

from typing import Union, Literal
from typing import Union
from datetime import date, datetime

from pydantic import Field

from githubkit.utils import UNSET
from githubkit.typing import Missing
from githubkit.compat import GitHubModel, model_rebuild

from .group_0048 import DependabotAlertPackage
from .group_0048 import Team
from .group_0001 import SimpleUser
from .group_0029 import OrganizationSimple


class DependabotAlertSecurityVulnerability(GitHubModel):
"""DependabotAlertSecurityVulnerability
class CopilotSeatDetails(GitHubModel):
"""Copilot Business Seat Detail
Details pertaining to one vulnerable version range for the advisory.
Information about a Copilot Business seat assignment for a user, team, or
organization.
"""

package: DependabotAlertPackage = Field(
description="Details for the vulnerable package."
assignee: Union[SimpleUser, Team, Organization] = Field(
description="The assignee that has been granted access to GitHub Copilot."
)
severity: Literal["low", "medium", "high", "critical"] = Field(
description="The severity of the vulnerability."
organization: Missing[Union[OrganizationSimple, None]] = Field(
default=UNSET, description="The organization to which this seat belongs."
)
vulnerable_version_range: str = Field(
description="Conditions that identify vulnerable versions of this vulnerability's package."
assigning_team: Missing[Union[Team, EnterpriseTeam, None]] = Field(
default=UNSET,
description="The team through which the assignee is granted access to GitHub Copilot, if applicable.",
)
first_patched_version: Union[
DependabotAlertSecurityVulnerabilityPropFirstPatchedVersion, None
] = Field(
description="Details pertaining to the package version that patches this vulnerability."
pending_cancellation_date: Missing[Union[date, None]] = Field(
default=UNSET,
description="The pending cancellation date for the seat, in `YYYY-MM-DD` format. This will be null unless the assignee's Copilot access has been canceled during the current billing cycle. If the seat has been cancelled, this corresponds to the start of the organization's next billing cycle.",
)
last_activity_at: Missing[Union[datetime, None]] = Field(
default=UNSET,
description="Timestamp of user's last GitHub Copilot activity, in ISO 8601 format.",
)
last_activity_editor: Missing[Union[str, None]] = Field(
default=UNSET,
description="Last editor that was used by the user for a GitHub Copilot completion.",
)
created_at: datetime = Field(
description="Timestamp of when the assignee was last granted access to GitHub Copilot, in ISO 8601 format."
)
updated_at: Missing[datetime] = Field(
default=UNSET,
description="Timestamp of when the assignee's GitHub Copilot access was last updated, in ISO 8601 format.",
)


class EnterpriseTeam(GitHubModel):
"""Enterprise Team
Group of enterprise owners and/or members
"""

id: int = Field()
name: str = Field()
slug: str = Field()
url: str = Field()
sync_to_organizations: str = Field()
group_id: Missing[Union[int, None]] = Field(default=UNSET)
html_url: str = Field()
members_url: str = Field()
created_at: datetime = Field()
updated_at: datetime = Field()


class DependabotAlertSecurityVulnerabilityPropFirstPatchedVersion(GitHubModel):
"""DependabotAlertSecurityVulnerabilityPropFirstPatchedVersion
class Organization(GitHubModel):
"""Organization
Details pertaining to the package version that patches this vulnerability.
GitHub account for managing multiple users, teams, and repositories
"""

identifier: str = Field(
description="The package version that patches this vulnerability."
login: str = Field(description="Unique login name of the organization")
url: str = Field(description="URL for the organization")
id: int = Field()
node_id: str = Field()
repos_url: str = Field()
events_url: str = Field()
hooks_url: str = Field()
issues_url: str = Field()
members_url: str = Field()
public_members_url: str = Field()
avatar_url: str = Field()
description: Union[str, None] = Field()
blog: Missing[str] = Field(
default=UNSET, description="Display blog url for the organization"
)
html_url: str = Field()
name: Missing[str] = Field(
default=UNSET, description="Display name for the organization"
)
company: Missing[str] = Field(
default=UNSET, description="Display company name for the organization"
)
location: Missing[str] = Field(
default=UNSET, description="Display location for the organization"
)
email: Missing[str] = Field(
default=UNSET, description="Display email for the organization"
)
has_organization_projects: bool = Field(
description="Specifies if organization projects are enabled for this org"
)
has_repository_projects: bool = Field(
description="Specifies if repository projects are enabled for repositories that belong to this org"
)
is_verified: Missing[bool] = Field(default=UNSET)
public_repos: int = Field()
public_gists: int = Field()
followers: int = Field()
following: int = Field()
type: str = Field()
created_at: datetime = Field()
updated_at: datetime = Field()
plan: Missing[OrganizationPropPlan] = Field(default=UNSET)


class OrganizationPropPlan(GitHubModel):
"""OrganizationPropPlan"""

name: Missing[str] = Field(default=UNSET)
space: Missing[int] = Field(default=UNSET)
private_repos: Missing[int] = Field(default=UNSET)
filled_seats: Missing[int] = Field(default=UNSET)
seats: Missing[int] = Field(default=UNSET)


model_rebuild(DependabotAlertSecurityVulnerability)
model_rebuild(DependabotAlertSecurityVulnerabilityPropFirstPatchedVersion)
model_rebuild(CopilotSeatDetails)
model_rebuild(EnterpriseTeam)
model_rebuild(Organization)
model_rebuild(OrganizationPropPlan)

__all__ = (
"DependabotAlertSecurityVulnerability",
"DependabotAlertSecurityVulnerabilityPropFirstPatchedVersion",
"CopilotSeatDetails",
"EnterpriseTeam",
"Organization",
"OrganizationPropPlan",
)
Loading

0 comments on commit 8f41ba1

Please sign in to comment.