|
9 | 9 |
|
10 | 10 | from __future__ import annotations
|
11 | 11 |
|
| 12 | +from datetime import datetime |
| 13 | +from typing import Literal, Union |
| 14 | + |
12 | 15 | from pydantic import Field
|
13 | 16 |
|
14 | 17 | from githubkit.compat import GitHubModel, model_rebuild
|
15 | 18 | from githubkit.typing import Missing
|
16 | 19 | from githubkit.utils import UNSET
|
17 | 20 |
|
| 21 | +from .group_0002 import SimpleUser |
| 22 | +from .group_0051 import SimpleRepository |
| 23 | + |
18 | 24 |
|
19 |
| -class ActionsBillingUsage(GitHubModel): |
20 |
| - """ActionsBillingUsage""" |
| 25 | +class OrganizationSecretScanningAlert(GitHubModel): |
| 26 | + """OrganizationSecretScanningAlert""" |
21 | 27 |
|
22 |
| - total_minutes_used: int = Field( |
23 |
| - description="The sum of the free and paid GitHub Actions minutes used." |
| 28 | + number: Missing[int] = Field( |
| 29 | + default=UNSET, description="The security alert number." |
24 | 30 | )
|
25 |
| - total_paid_minutes_used: int = Field( |
26 |
| - description="The total paid GitHub Actions minutes used." |
| 31 | + created_at: Missing[datetime] = Field( |
| 32 | + default=UNSET, |
| 33 | + description="The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.", |
27 | 34 | )
|
28 |
| - included_minutes: int = Field( |
29 |
| - description="The amount of free GitHub Actions minutes available." |
| 35 | + updated_at: Missing[Union[None, datetime]] = Field(default=UNSET) |
| 36 | + url: Missing[str] = Field( |
| 37 | + default=UNSET, description="The REST API URL of the alert resource." |
30 | 38 | )
|
31 |
| - minutes_used_breakdown: ActionsBillingUsagePropMinutesUsedBreakdown = Field() |
32 |
| - |
33 |
| - |
34 |
| -class ActionsBillingUsagePropMinutesUsedBreakdown(GitHubModel): |
35 |
| - """ActionsBillingUsagePropMinutesUsedBreakdown""" |
36 |
| - |
37 |
| - ubuntu: Missing[int] = Field( |
38 |
| - default=UNSET, |
39 |
| - alias="UBUNTU", |
40 |
| - description="Total minutes used on Ubuntu runner machines.", |
| 39 | + html_url: Missing[str] = Field( |
| 40 | + default=UNSET, description="The GitHub URL of the alert resource." |
41 | 41 | )
|
42 |
| - macos: Missing[int] = Field( |
| 42 | + locations_url: Missing[str] = Field( |
43 | 43 | default=UNSET,
|
44 |
| - alias="MACOS", |
45 |
| - description="Total minutes used on macOS runner machines.", |
| 44 | + description="The REST API URL of the code locations for this alert.", |
46 | 45 | )
|
47 |
| - windows: Missing[int] = Field( |
| 46 | + state: Missing[Literal["open", "resolved"]] = Field( |
48 | 47 | default=UNSET,
|
49 |
| - alias="WINDOWS", |
50 |
| - description="Total minutes used on Windows runner machines.", |
| 48 | + description="Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`.", |
51 | 49 | )
|
52 |
| - ubuntu_4_core: Missing[int] = Field( |
| 50 | + resolution: Missing[ |
| 51 | + Union[None, Literal["false_positive", "wont_fix", "revoked", "used_in_tests"]] |
| 52 | + ] = Field( |
53 | 53 | default=UNSET,
|
54 |
| - description="Total minutes used on Ubuntu 4 core runner machines.", |
| 54 | + description="**Required when the `state` is `resolved`.** The reason for resolving the alert.", |
55 | 55 | )
|
56 |
| - ubuntu_8_core: Missing[int] = Field( |
| 56 | + resolved_at: Missing[Union[datetime, None]] = Field( |
57 | 57 | default=UNSET,
|
58 |
| - description="Total minutes used on Ubuntu 8 core runner machines.", |
| 58 | + description="The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.", |
59 | 59 | )
|
60 |
| - ubuntu_16_core: Missing[int] = Field( |
61 |
| - default=UNSET, |
62 |
| - description="Total minutes used on Ubuntu 16 core runner machines.", |
| 60 | + resolved_by: Missing[Union[None, SimpleUser]] = Field(default=UNSET) |
| 61 | + secret_type: Missing[str] = Field( |
| 62 | + default=UNSET, description="The type of secret that secret scanning detected." |
63 | 63 | )
|
64 |
| - ubuntu_32_core: Missing[int] = Field( |
| 64 | + secret_type_display_name: Missing[str] = Field( |
65 | 65 | default=UNSET,
|
66 |
| - description="Total minutes used on Ubuntu 32 core runner machines.", |
| 66 | + description='User-friendly name for the detected secret, matching the `secret_type`.\nFor a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/enterprise-cloud@latest//code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)."', |
67 | 67 | )
|
68 |
| - ubuntu_64_core: Missing[int] = Field( |
69 |
| - default=UNSET, |
70 |
| - description="Total minutes used on Ubuntu 64 core runner machines.", |
| 68 | + secret: Missing[str] = Field( |
| 69 | + default=UNSET, description="The secret that was detected." |
71 | 70 | )
|
72 |
| - windows_4_core: Missing[int] = Field( |
73 |
| - default=UNSET, |
74 |
| - description="Total minutes used on Windows 4 core runner machines.", |
| 71 | + repository: Missing[SimpleRepository] = Field( |
| 72 | + default=UNSET, title="Simple Repository", description="A GitHub repository." |
75 | 73 | )
|
76 |
| - windows_8_core: Missing[int] = Field( |
| 74 | + push_protection_bypassed: Missing[Union[bool, None]] = Field( |
77 | 75 | default=UNSET,
|
78 |
| - description="Total minutes used on Windows 8 core runner machines.", |
| 76 | + description="Whether push protection was bypassed for the detected secret.", |
79 | 77 | )
|
80 |
| - windows_16_core: Missing[int] = Field( |
| 78 | + push_protection_bypassed_by: Missing[Union[None, SimpleUser]] = Field(default=UNSET) |
| 79 | + push_protection_bypassed_at: Missing[Union[datetime, None]] = Field( |
81 | 80 | default=UNSET,
|
82 |
| - description="Total minutes used on Windows 16 core runner machines.", |
| 81 | + description="The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.", |
83 | 82 | )
|
84 |
| - windows_32_core: Missing[int] = Field( |
85 |
| - default=UNSET, |
86 |
| - description="Total minutes used on Windows 32 core runner machines.", |
| 83 | + push_protection_bypass_request_reviewer: Missing[Union[None, SimpleUser]] = Field( |
| 84 | + default=UNSET |
87 | 85 | )
|
88 |
| - windows_64_core: Missing[int] = Field( |
| 86 | + push_protection_bypass_request_comment: Missing[Union[str, None]] = Field( |
89 | 87 | default=UNSET,
|
90 |
| - description="Total minutes used on Windows 64 core runner machines.", |
| 88 | + description="An optional comment when requesting a push protection bypass.", |
| 89 | + ) |
| 90 | + push_protection_bypass_request_html_url: Missing[Union[str, None]] = Field( |
| 91 | + default=UNSET, description="The URL to a push protection bypass request." |
91 | 92 | )
|
92 |
| - macos_12_core: Missing[int] = Field( |
| 93 | + resolution_comment: Missing[Union[str, None]] = Field( |
93 | 94 | default=UNSET,
|
94 |
| - description="Total minutes used on macOS 12 core runner machines.", |
| 95 | + description="The comment that was optionally added when this alert was closed", |
95 | 96 | )
|
96 |
| - total: Missing[int] = Field( |
97 |
| - default=UNSET, description="Total minutes used on all runner machines." |
| 97 | + validity: Missing[Literal["active", "inactive", "unknown"]] = Field( |
| 98 | + default=UNSET, description="The token status as of the latest validity check." |
| 99 | + ) |
| 100 | + publicly_leaked: Missing[Union[bool, None]] = Field( |
| 101 | + default=UNSET, description="Whether the secret was publicly leaked." |
| 102 | + ) |
| 103 | + multi_repo: Missing[Union[bool, None]] = Field( |
| 104 | + default=UNSET, |
| 105 | + description="Whether the detected secret was found in multiple repositories in the same organization or enterprise.", |
98 | 106 | )
|
99 | 107 |
|
100 | 108 |
|
101 |
| -model_rebuild(ActionsBillingUsage) |
102 |
| -model_rebuild(ActionsBillingUsagePropMinutesUsedBreakdown) |
| 109 | +model_rebuild(OrganizationSecretScanningAlert) |
103 | 110 |
|
104 |
| -__all__ = ( |
105 |
| - "ActionsBillingUsage", |
106 |
| - "ActionsBillingUsagePropMinutesUsedBreakdown", |
107 |
| -) |
| 111 | +__all__ = ("OrganizationSecretScanningAlert",) |
0 commit comments