:calls: `PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id} `_
(
self,
summary: Opt[str] = NotSet,
description: Opt[str] = NotSet,
severity_or_cvss_vector_string: Opt[str] = NotSet,
cve_id: Opt[str] = NotSet,
vulnerabilities: Opt[Iterable[AdvisoryVulnerabilityInput]] = NotSet,
cwe_ids: Opt[Iterable[str]] = NotSet,
credits: Opt[Iterable[Credit]] = NotSet,
state: Opt[str] = NotSet,
)
| 260 | self._useAttributes(data) |
| 261 | |
| 262 | def edit( |
| 263 | self, |
| 264 | summary: Opt[str] = NotSet, |
| 265 | description: Opt[str] = NotSet, |
| 266 | severity_or_cvss_vector_string: Opt[str] = NotSet, |
| 267 | cve_id: Opt[str] = NotSet, |
| 268 | vulnerabilities: Opt[Iterable[AdvisoryVulnerabilityInput]] = NotSet, |
| 269 | cwe_ids: Opt[Iterable[str]] = NotSet, |
| 270 | credits: Opt[Iterable[Credit]] = NotSet, |
| 271 | state: Opt[str] = NotSet, |
| 272 | ) -> RepositoryAdvisory: |
| 273 | """ |
| 274 | :calls: `PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id} <https://docs.github.com/en/rest/security-advisories/repository-advisories>`_ |
| 275 | """ |
| 276 | assert summary is NotSet or isinstance(summary, str), summary |
| 277 | assert description is NotSet or isinstance(description, str), description |
| 278 | assert severity_or_cvss_vector_string is NotSet or isinstance( |
| 279 | severity_or_cvss_vector_string, str |
| 280 | ), severity_or_cvss_vector_string |
| 281 | assert cve_id is NotSet or isinstance(cve_id, str), cve_id |
| 282 | assert vulnerabilities is NotSet or isinstance(vulnerabilities, Iterable), vulnerabilities |
| 283 | if isinstance(vulnerabilities, Iterable): |
| 284 | for vulnerability in vulnerabilities: |
| 285 | github.AdvisoryVulnerability.AdvisoryVulnerability._validate_vulnerability(vulnerability) |
| 286 | assert cwe_ids is NotSet or ( |
| 287 | isinstance(cwe_ids, Iterable) and all(isinstance(element, str) for element in cwe_ids) |
| 288 | ), cwe_ids |
| 289 | if isinstance(credits, Iterable): |
| 290 | for credit in credits: |
| 291 | github.AdvisoryCredit.AdvisoryCredit._validate_credit(credit) |
| 292 | assert state is NotSet or isinstance(state, str), state |
| 293 | patch_parameters: dict[str, Any] = {} |
| 294 | if summary is not NotSet: |
| 295 | patch_parameters["summary"] = summary |
| 296 | if description is not NotSet: |
| 297 | patch_parameters["description"] = description |
| 298 | if isinstance(severity_or_cvss_vector_string, str): |
| 299 | if severity_or_cvss_vector_string.startswith("CVSS:"): |
| 300 | patch_parameters["cvss_vector_string"] = severity_or_cvss_vector_string |
| 301 | else: |
| 302 | patch_parameters["severity"] = severity_or_cvss_vector_string |
| 303 | if cve_id is not NotSet: |
| 304 | patch_parameters["cve_id"] = cve_id |
| 305 | if isinstance(vulnerabilities, Iterable): |
| 306 | patch_parameters["vulnerabilities"] = [ |
| 307 | github.AdvisoryVulnerability.AdvisoryVulnerability._to_github_dict(vulnerability) |
| 308 | for vulnerability in vulnerabilities |
| 309 | ] |
| 310 | if isinstance(cwe_ids, Iterable): |
| 311 | patch_parameters["cwe_ids"] = list(cwe_ids) |
| 312 | if isinstance(credits, Iterable): |
| 313 | patch_parameters["credits"] = [ |
| 314 | github.AdvisoryCredit.AdvisoryCredit._to_github_dict(credit) for credit in credits |
| 315 | ] |
| 316 | if state is not NotSet: |
| 317 | patch_parameters["state"] = state |
| 318 | headers, data = self._requester.requestJsonAndCheck( |
| 319 | "PATCH", |
nothing calls this directly
no test coverage detected