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: date query param format #139

Merged
merged 2 commits into from
Sep 27, 2024
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.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
12 changes: 11 additions & 1 deletion githubkit/rest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
from githubkit.versions.v2022_11_28.models import ContentSymlink as ContentSymlink
from githubkit.versions.v2022_11_28.models import ContentTraffic as ContentTraffic
from githubkit.versions.v2022_11_28.models import CustomProperty as CustomProperty
from githubkit.versions.v2022_11_28.models import CvssSeverities as CvssSeverities
from githubkit.versions.v2022_11_28.models import EnterpriseTeam as EnterpriseTeam
from githubkit.versions.v2022_11_28.models import FullRepository as FullRepository
from githubkit.versions.v2022_11_28.models import GlobalAdvisory as GlobalAdvisory
Expand Down Expand Up @@ -1079,6 +1080,12 @@
from githubkit.versions.v2022_11_28.models import (
CommitPropCommitPropTree as CommitPropCommitPropTree,
)
from githubkit.versions.v2022_11_28.models import (
CvssSeveritiesPropCvssV3 as CvssSeveritiesPropCvssV3,
)
from githubkit.versions.v2022_11_28.models import (
CvssSeveritiesPropCvssV4 as CvssSeveritiesPropCvssV4,
)
from githubkit.versions.v2022_11_28.models import (
DependencyGraphDiffItems as DependencyGraphDiffItems,
)
Expand Down Expand Up @@ -9399,15 +9406,18 @@
__lazy_vars__ = {
"githubkit.versions.v2022_11_28.models": (
"Root",
"CvssSeverities",
"CvssSeveritiesPropCvssV3",
"CvssSeveritiesPropCvssV4",
"SimpleUser",
"GlobalAdvisoryPropCreditsItems",
"GlobalAdvisory",
"GlobalAdvisoryPropIdentifiersItems",
"GlobalAdvisoryPropCvss",
"GlobalAdvisoryPropCwesItems",
"GlobalAdvisoryPropEpss",
"Vulnerability",
"VulnerabilityPropPackage",
"GlobalAdvisoryPropCreditsItems",
"BasicError",
"ValidationErrorSimple",
"IntegrationPropPermissions",
Expand Down
9,162 changes: 4,585 additions & 4,577 deletions githubkit/versions/ghec_v2022_11_28/models/__init__.py

Large diffs are not rendered by default.

67 changes: 35 additions & 32 deletions githubkit/versions/ghec_v2022_11_28/models/group_0001.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from __future__ import annotations

from typing import Union
from typing_extensions import Annotated

Check warning on line 13 in githubkit/versions/ghec_v2022_11_28/models/group_0001.py

View check run for this annotation

Codecov / codecov/patch

githubkit/versions/ghec_v2022_11_28/models/group_0001.py#L13

Added line #L13 was not covered by tests

from pydantic import Field

Expand All @@ -18,35 +19,37 @@
from githubkit.compat import GitHubModel, model_rebuild


class SimpleUser(GitHubModel):
"""Simple User

A GitHub user.
"""

name: Missing[Union[str, None]] = Field(default=UNSET)
email: Missing[Union[str, None]] = Field(default=UNSET)
login: str = Field()
id: int = Field()
node_id: str = Field()
avatar_url: str = Field()
gravatar_id: Union[str, None] = Field()
url: str = Field()
html_url: str = Field()
followers_url: str = Field()
following_url: str = Field()
gists_url: str = Field()
starred_url: str = Field()
subscriptions_url: str = Field()
organizations_url: str = Field()
repos_url: str = Field()
events_url: str = Field()
received_events_url: str = Field()
type: str = Field()
site_admin: bool = Field()
starred_at: Missing[str] = Field(default=UNSET)


model_rebuild(SimpleUser)

__all__ = ("SimpleUser",)
class CvssSeverities(GitHubModel):

Check warning on line 22 in githubkit/versions/ghec_v2022_11_28/models/group_0001.py

View check run for this annotation

Codecov / codecov/patch

githubkit/versions/ghec_v2022_11_28/models/group_0001.py#L22

Added line #L22 was not covered by tests
"""CvssSeverities"""

cvss_v3: Missing[Union[CvssSeveritiesPropCvssV3, None]] = Field(default=UNSET)
cvss_v4: Missing[Union[CvssSeveritiesPropCvssV4, None]] = Field(default=UNSET)

Check warning on line 26 in githubkit/versions/ghec_v2022_11_28/models/group_0001.py

View check run for this annotation

Codecov / codecov/patch

githubkit/versions/ghec_v2022_11_28/models/group_0001.py#L25-L26

Added lines #L25 - L26 were not covered by tests


class CvssSeveritiesPropCvssV3(GitHubModel):

Check warning on line 29 in githubkit/versions/ghec_v2022_11_28/models/group_0001.py

View check run for this annotation

Codecov / codecov/patch

githubkit/versions/ghec_v2022_11_28/models/group_0001.py#L29

Added line #L29 was not covered by tests
"""CvssSeveritiesPropCvssV3"""

vector_string: Union[str, None] = Field(description="The CVSS 3 vector string.")
score: Union[Annotated[float, Field(le=10.0)], None] = Field(

Check warning on line 33 in githubkit/versions/ghec_v2022_11_28/models/group_0001.py

View check run for this annotation

Codecov / codecov/patch

githubkit/versions/ghec_v2022_11_28/models/group_0001.py#L32-L33

Added lines #L32 - L33 were not covered by tests
description="The CVSS 3 score."
)


class CvssSeveritiesPropCvssV4(GitHubModel):

Check warning on line 38 in githubkit/versions/ghec_v2022_11_28/models/group_0001.py

View check run for this annotation

Codecov / codecov/patch

githubkit/versions/ghec_v2022_11_28/models/group_0001.py#L38

Added line #L38 was not covered by tests
"""CvssSeveritiesPropCvssV4"""

vector_string: Union[str, None] = Field(description="The CVSS 4 vector string.")
score: Union[Annotated[float, Field(le=10.0)], None] = Field(

Check warning on line 42 in githubkit/versions/ghec_v2022_11_28/models/group_0001.py

View check run for this annotation

Codecov / codecov/patch

githubkit/versions/ghec_v2022_11_28/models/group_0001.py#L41-L42

Added lines #L41 - L42 were not covered by tests
description="The CVSS 4 score."
)


model_rebuild(CvssSeverities)
model_rebuild(CvssSeveritiesPropCvssV3)
model_rebuild(CvssSeveritiesPropCvssV4)

Check warning on line 49 in githubkit/versions/ghec_v2022_11_28/models/group_0001.py

View check run for this annotation

Codecov / codecov/patch

githubkit/versions/ghec_v2022_11_28/models/group_0001.py#L47-L49

Added lines #L47 - L49 were not covered by tests

__all__ = (

Check warning on line 51 in githubkit/versions/ghec_v2022_11_28/models/group_0001.py

View check run for this annotation

Codecov / codecov/patch

githubkit/versions/ghec_v2022_11_28/models/group_0001.py#L51

Added line #L51 was not covered by tests
"CvssSeverities",
"CvssSeveritiesPropCvssV3",
"CvssSeveritiesPropCvssV4",
)
204 changes: 30 additions & 174 deletions githubkit/versions/ghec_v2022_11_28/models/group_0002.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,188 +9,44 @@

from __future__ import annotations

from datetime import datetime
from typing import List, Union, Literal
from typing_extensions import Annotated
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_0001 import SimpleUser

class SimpleUser(GitHubModel):
"""Simple User

class GlobalAdvisoryPropCreditsItems(GitHubModel):
"""GlobalAdvisoryPropCreditsItems"""

user: SimpleUser = Field(title="Simple User", description="A GitHub user.")
type: Literal[
"analyst",
"finder",
"reporter",
"coordinator",
"remediation_developer",
"remediation_reviewer",
"remediation_verifier",
"tool",
"sponsor",
"other",
] = Field(description="The type of credit the user is receiving.")


class GlobalAdvisory(GitHubModel):
"""GlobalAdvisory

A GitHub Security Advisory.
A GitHub user.
"""

ghsa_id: str = Field(description="The GitHub Security Advisory ID.")
cve_id: Union[str, None] = Field(
description="The Common Vulnerabilities and Exposures (CVE) ID."
)
url: str = Field(description="The API URL for the advisory.")
html_url: str = Field(description="The URL for the advisory.")
repository_advisory_url: Union[str, None] = Field(
description="The API URL for the repository advisory."
)
summary: str = Field(
max_length=1024, description="A short summary of the advisory."
)
description: Union[Annotated[str, Field(max_length=65535)], None] = Field(
description="A detailed description of what the advisory entails."
)
type: Literal["reviewed", "unreviewed", "malware"] = Field(
description="The type of advisory."
)
severity: Literal["critical", "high", "medium", "low", "unknown"] = Field(
description="The severity of the advisory."
)
source_code_location: Union[str, None] = Field(
description="The URL of the advisory's source code."
)
identifiers: Union[List[GlobalAdvisoryPropIdentifiersItems], None] = Field()
references: Union[List[str], None] = Field()
published_at: datetime = Field(
description="The date and time of when the advisory was published, in ISO 8601 format."
)
updated_at: datetime = Field(
description="The date and time of when the advisory was last updated, in ISO 8601 format."
)
github_reviewed_at: Union[datetime, None] = Field(
description="The date and time of when the advisory was reviewed by GitHub, in ISO 8601 format."
)
nvd_published_at: Union[datetime, None] = Field(
description="The date and time when the advisory was published in the National Vulnerability Database, in ISO 8601 format.\nThis field is only populated when the advisory is imported from the National Vulnerability Database."
)
withdrawn_at: Union[datetime, None] = Field(
description="The date and time of when the advisory was withdrawn, in ISO 8601 format."
)
vulnerabilities: Union[List[Vulnerability], None] = Field(
description="The products and respective version ranges affected by the advisory."
)
cvss: Union[GlobalAdvisoryPropCvss, None] = Field()
cwes: Union[List[GlobalAdvisoryPropCwesItems], None] = Field()
epss: Missing[Union[GlobalAdvisoryPropEpss, None]] = Field(default=UNSET)
credits_: Union[List[GlobalAdvisoryPropCreditsItems], None] = Field(
alias="credits", description="The users who contributed to the advisory."
)


class GlobalAdvisoryPropIdentifiersItems(GitHubModel):
"""GlobalAdvisoryPropIdentifiersItems"""

type: Literal["CVE", "GHSA"] = Field(description="The type of identifier.")
value: str = Field(description="The identifier value.")


class GlobalAdvisoryPropCvss(GitHubModel):
"""GlobalAdvisoryPropCvss"""

vector_string: Union[str, None] = Field(description="The CVSS vector.")
score: Union[Annotated[float, Field(le=10.0)], None] = Field(
description="The CVSS score."
)


class GlobalAdvisoryPropCwesItems(GitHubModel):
"""GlobalAdvisoryPropCwesItems"""

cwe_id: str = Field(description="The Common Weakness Enumeration (CWE) identifier.")
name: str = Field(description="The name of the CWE.")


class GlobalAdvisoryPropEpss(GitHubModel):
"""GlobalAdvisoryPropEpss"""

percentage: Missing[float] = Field(default=UNSET)
percentile: Missing[float] = Field(default=UNSET)


class Vulnerability(GitHubModel):
"""Vulnerability

A vulnerability describing the product and its affected versions within a GitHub
Security Advisory.
"""

package: Union[VulnerabilityPropPackage, None] = Field(
description="The name of the package affected by the vulnerability."
)
vulnerable_version_range: Union[str, None] = Field(
description="The range of the package versions affected by the vulnerability."
)
first_patched_version: Union[str, None] = Field(
description="The package version that resolves the vulnerability."
)
vulnerable_functions: Union[List[str], None] = Field(
description="The functions in the package that are affected by the vulnerability."
)


class VulnerabilityPropPackage(GitHubModel):
"""VulnerabilityPropPackage

The name of the package affected by the vulnerability.
"""

ecosystem: Literal[
"rubygems",
"npm",
"pip",
"maven",
"nuget",
"composer",
"go",
"rust",
"erlang",
"actions",
"pub",
"other",
"swift",
] = Field(description="The package's language or package management ecosystem.")
name: Union[str, None] = Field(
description="The unique package name within its ecosystem."
)


model_rebuild(GlobalAdvisoryPropCreditsItems)
model_rebuild(GlobalAdvisory)
model_rebuild(GlobalAdvisoryPropIdentifiersItems)
model_rebuild(GlobalAdvisoryPropCvss)
model_rebuild(GlobalAdvisoryPropCwesItems)
model_rebuild(GlobalAdvisoryPropEpss)
model_rebuild(Vulnerability)
model_rebuild(VulnerabilityPropPackage)

__all__ = (
"GlobalAdvisoryPropCreditsItems",
"GlobalAdvisory",
"GlobalAdvisoryPropIdentifiersItems",
"GlobalAdvisoryPropCvss",
"GlobalAdvisoryPropCwesItems",
"GlobalAdvisoryPropEpss",
"Vulnerability",
"VulnerabilityPropPackage",
)
name: Missing[Union[str, None]] = Field(default=UNSET)
email: Missing[Union[str, None]] = Field(default=UNSET)
login: str = Field()
id: int = Field()
node_id: str = Field()
avatar_url: str = Field()
gravatar_id: Union[str, None] = Field()
url: str = Field()
html_url: str = Field()
followers_url: str = Field()
following_url: str = Field()
gists_url: str = Field()
starred_url: str = Field()
subscriptions_url: str = Field()
organizations_url: str = Field()
repos_url: str = Field()
events_url: str = Field()
received_events_url: str = Field()
type: str = Field()
site_admin: bool = Field()
starred_at: Missing[str] = Field(default=UNSET)


model_rebuild(SimpleUser)

__all__ = ("SimpleUser",)
Loading
Loading