|
9 | 9 |
|
10 | 10 | from __future__ import annotations |
11 | 11 |
|
12 | | -from typing import Union |
| 12 | +from typing import Literal, Union |
13 | 13 |
|
14 | 14 | from pydantic import Field |
15 | 15 |
|
16 | 16 | from githubkit.compat import GitHubModel, model_rebuild |
| 17 | +from githubkit.typing import Missing |
| 18 | +from githubkit.utils import UNSET |
17 | 19 |
|
18 | | -from .group_0003 import SimpleUser |
| 20 | +from .group_0071 import CodeScanningAlertLocation |
19 | 21 |
|
20 | 22 |
|
21 | | -class SimpleRepository(GitHubModel): |
22 | | - """Simple Repository |
| 23 | +class CodeScanningAlertInstance(GitHubModel): |
| 24 | + """CodeScanningAlertInstance""" |
23 | 25 |
|
24 | | - A GitHub repository. |
25 | | - """ |
26 | | - |
27 | | - id: int = Field(description="A unique identifier of the repository.") |
28 | | - node_id: str = Field(description="The GraphQL identifier of the repository.") |
29 | | - name: str = Field(description="The name of the repository.") |
30 | | - full_name: str = Field( |
31 | | - description="The full, globally unique, name of the repository." |
32 | | - ) |
33 | | - owner: SimpleUser = Field(title="Simple User", description="A GitHub user.") |
34 | | - private: bool = Field(description="Whether the repository is private.") |
35 | | - html_url: str = Field(description="The URL to view the repository on GitHub.com.") |
36 | | - description: Union[str, None] = Field(description="The repository description.") |
37 | | - fork: bool = Field(description="Whether the repository is a fork.") |
38 | | - url: str = Field( |
39 | | - description="The URL to get more information about the repository from the GitHub API." |
40 | | - ) |
41 | | - archive_url: str = Field( |
42 | | - description="A template for the API URL to download the repository as an archive." |
43 | | - ) |
44 | | - assignees_url: str = Field( |
45 | | - description="A template for the API URL to list the available assignees for issues in the repository." |
46 | | - ) |
47 | | - blobs_url: str = Field( |
48 | | - description="A template for the API URL to create or retrieve a raw Git blob in the repository." |
49 | | - ) |
50 | | - branches_url: str = Field( |
51 | | - description="A template for the API URL to get information about branches in the repository." |
52 | | - ) |
53 | | - collaborators_url: str = Field( |
54 | | - description="A template for the API URL to get information about collaborators of the repository." |
55 | | - ) |
56 | | - comments_url: str = Field( |
57 | | - description="A template for the API URL to get information about comments on the repository." |
58 | | - ) |
59 | | - commits_url: str = Field( |
60 | | - description="A template for the API URL to get information about commits on the repository." |
61 | | - ) |
62 | | - compare_url: str = Field( |
63 | | - description="A template for the API URL to compare two commits or refs." |
64 | | - ) |
65 | | - contents_url: str = Field( |
66 | | - description="A template for the API URL to get the contents of the repository." |
67 | | - ) |
68 | | - contributors_url: str = Field( |
69 | | - description="A template for the API URL to list the contributors to the repository." |
70 | | - ) |
71 | | - deployments_url: str = Field( |
72 | | - description="The API URL to list the deployments of the repository." |
73 | | - ) |
74 | | - downloads_url: str = Field( |
75 | | - description="The API URL to list the downloads on the repository." |
76 | | - ) |
77 | | - events_url: str = Field( |
78 | | - description="The API URL to list the events of the repository." |
79 | | - ) |
80 | | - forks_url: str = Field( |
81 | | - description="The API URL to list the forks of the repository." |
82 | | - ) |
83 | | - git_commits_url: str = Field( |
84 | | - description="A template for the API URL to get information about Git commits of the repository." |
85 | | - ) |
86 | | - git_refs_url: str = Field( |
87 | | - description="A template for the API URL to get information about Git refs of the repository." |
88 | | - ) |
89 | | - git_tags_url: str = Field( |
90 | | - description="A template for the API URL to get information about Git tags of the repository." |
91 | | - ) |
92 | | - issue_comment_url: str = Field( |
93 | | - description="A template for the API URL to get information about issue comments on the repository." |
94 | | - ) |
95 | | - issue_events_url: str = Field( |
96 | | - description="A template for the API URL to get information about issue events on the repository." |
97 | | - ) |
98 | | - issues_url: str = Field( |
99 | | - description="A template for the API URL to get information about issues on the repository." |
100 | | - ) |
101 | | - keys_url: str = Field( |
102 | | - description="A template for the API URL to get information about deploy keys on the repository." |
103 | | - ) |
104 | | - labels_url: str = Field( |
105 | | - description="A template for the API URL to get information about labels of the repository." |
106 | | - ) |
107 | | - languages_url: str = Field( |
108 | | - description="The API URL to get information about the languages of the repository." |
109 | | - ) |
110 | | - merges_url: str = Field( |
111 | | - description="The API URL to merge branches in the repository." |
112 | | - ) |
113 | | - milestones_url: str = Field( |
114 | | - description="A template for the API URL to get information about milestones of the repository." |
115 | | - ) |
116 | | - notifications_url: str = Field( |
117 | | - description="A template for the API URL to get information about notifications on the repository." |
118 | | - ) |
119 | | - pulls_url: str = Field( |
120 | | - description="A template for the API URL to get information about pull requests on the repository." |
121 | | - ) |
122 | | - releases_url: str = Field( |
123 | | - description="A template for the API URL to get information about releases on the repository." |
124 | | - ) |
125 | | - stargazers_url: str = Field( |
126 | | - description="The API URL to list the stargazers on the repository." |
127 | | - ) |
128 | | - statuses_url: str = Field( |
129 | | - description="A template for the API URL to get information about statuses of a commit." |
130 | | - ) |
131 | | - subscribers_url: str = Field( |
132 | | - description="The API URL to list the subscribers on the repository." |
133 | | - ) |
134 | | - subscription_url: str = Field( |
135 | | - description="The API URL to subscribe to notifications for this repository." |
136 | | - ) |
137 | | - tags_url: str = Field( |
138 | | - description="The API URL to get information about tags on the repository." |
139 | | - ) |
140 | | - teams_url: str = Field( |
141 | | - description="The API URL to list the teams on the repository." |
142 | | - ) |
143 | | - trees_url: str = Field( |
144 | | - description="A template for the API URL to create or retrieve a raw Git tree of the repository." |
145 | | - ) |
146 | | - hooks_url: str = Field( |
147 | | - description="The API URL to list the hooks on the repository." |
| 26 | + ref: Missing[str] = Field( |
| 27 | + default=UNSET, |
| 28 | + description="The Git reference, formatted as `refs/pull/<number>/merge`, `refs/pull/<number>/head`,\n`refs/heads/<branch name>` or simply `<branch name>`.", |
| 29 | + ) |
| 30 | + analysis_key: Missing[str] = Field( |
| 31 | + default=UNSET, |
| 32 | + description="Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name.", |
| 33 | + ) |
| 34 | + environment: Missing[str] = Field( |
| 35 | + default=UNSET, |
| 36 | + description="Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed.", |
| 37 | + ) |
| 38 | + category: Missing[str] = Field( |
| 39 | + default=UNSET, |
| 40 | + description="Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code.", |
| 41 | + ) |
| 42 | + state: Missing[Union[None, Literal["open", "dismissed", "fixed"]]] = Field( |
| 43 | + default=UNSET, description="State of a code scanning alert." |
| 44 | + ) |
| 45 | + commit_sha: Missing[str] = Field(default=UNSET) |
| 46 | + message: Missing[CodeScanningAlertInstancePropMessage] = Field(default=UNSET) |
| 47 | + location: Missing[CodeScanningAlertLocation] = Field( |
| 48 | + default=UNSET, description="Describe a region within a file for the alert." |
| 49 | + ) |
| 50 | + html_url: Missing[str] = Field(default=UNSET) |
| 51 | + classifications: Missing[ |
| 52 | + list[ |
| 53 | + Union[ |
| 54 | + None, Literal["source", "generated", "test", "library", "documentation"] |
| 55 | + ] |
| 56 | + ] |
| 57 | + ] = Field( |
| 58 | + default=UNSET, |
| 59 | + description="Classifications that have been applied to the file that triggered the alert.\nFor example identifying it as documentation, or a generated file.", |
148 | 60 | ) |
149 | 61 |
|
150 | 62 |
|
151 | | -model_rebuild(SimpleRepository) |
| 63 | +class CodeScanningAlertInstancePropMessage(GitHubModel): |
| 64 | + """CodeScanningAlertInstancePropMessage""" |
| 65 | + |
| 66 | + text: Missing[str] = Field(default=UNSET) |
| 67 | + |
| 68 | + |
| 69 | +model_rebuild(CodeScanningAlertInstance) |
| 70 | +model_rebuild(CodeScanningAlertInstancePropMessage) |
152 | 71 |
|
153 | | -__all__ = ("SimpleRepository",) |
| 72 | +__all__ = ( |
| 73 | + "CodeScanningAlertInstance", |
| 74 | + "CodeScanningAlertInstancePropMessage", |
| 75 | +) |
0 commit comments