|
9 | 9 |
|
10 | 10 | from __future__ import annotations |
11 | 11 |
|
| 12 | +from typing import Literal, Union |
| 13 | + |
12 | 14 | from pydantic import Field |
13 | 15 |
|
14 | 16 | from githubkit.compat import ExtraGitHubModel, GitHubModel, model_rebuild |
15 | 17 | from githubkit.typing import Missing |
16 | 18 | from githubkit.utils import UNSET |
17 | 19 |
|
18 | 20 |
|
19 | | -class GistsGistIdPatchBody(GitHubModel): |
20 | | - """GistsGistIdPatchBody""" |
| 21 | +class GistsPostBody(GitHubModel): |
| 22 | + """GistsPostBody""" |
21 | 23 |
|
22 | 24 | description: Missing[str] = Field( |
23 | | - default=UNSET, description="The description of the gist." |
| 25 | + default=UNSET, description="Description of the gist" |
24 | 26 | ) |
25 | | - files: Missing[GistsGistIdPatchBodyPropFiles] = Field( |
26 | | - default=UNSET, |
27 | | - description="The gist files to be updated, renamed, or deleted. Each `key` must match the current filename\n(including extension) of the targeted gist file. For example: `hello.py`.\n\nTo delete a file, set the whole file to null. For example: `hello.py : null`. The file will also be\ndeleted if the specified object does not contain at least one of `content` or `filename`.", |
| 27 | + files: GistsPostBodyPropFiles = Field( |
| 28 | + description="Names and content for the files that make up the gist" |
28 | 29 | ) |
| 30 | + public: Missing[Union[bool, Literal["true", "false"]]] = Field(default=UNSET) |
29 | 31 |
|
30 | 32 |
|
31 | | -class GistsGistIdPatchBodyPropFiles(ExtraGitHubModel): |
32 | | - """GistsGistIdPatchBodyPropFiles |
33 | | -
|
34 | | - The gist files to be updated, renamed, or deleted. Each `key` must match the |
35 | | - current filename |
36 | | - (including extension) of the targeted gist file. For example: `hello.py`. |
| 33 | +class GistsPostBodyPropFiles(ExtraGitHubModel): |
| 34 | + """GistsPostBodyPropFiles |
37 | 35 |
|
38 | | - To delete a file, set the whole file to null. For example: `hello.py : null`. |
39 | | - The file will also be |
40 | | - deleted if the specified object does not contain at least one of `content` or |
41 | | - `filename`. |
| 36 | + Names and content for the files that make up the gist |
42 | 37 |
|
43 | 38 | Examples: |
44 | | - {'hello.rb': {'content': 'blah', 'filename': 'goodbye.rb'}} |
| 39 | + {'hello.rb': {'content': 'puts "Hello, World!"'}} |
45 | 40 | """ |
46 | 41 |
|
47 | 42 |
|
48 | | -model_rebuild(GistsGistIdPatchBody) |
49 | | -model_rebuild(GistsGistIdPatchBodyPropFiles) |
| 43 | +model_rebuild(GistsPostBody) |
| 44 | +model_rebuild(GistsPostBodyPropFiles) |
50 | 45 |
|
51 | 46 | __all__ = ( |
52 | | - "GistsGistIdPatchBody", |
53 | | - "GistsGistIdPatchBodyPropFiles", |
| 47 | + "GistsPostBody", |
| 48 | + "GistsPostBodyPropFiles", |
54 | 49 | ) |
0 commit comments