openapi_github/models/code_scanning_upload_sarif_request.rs
1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CodeScanningUploadSarifRequest {
16 /// The SHA of the commit to which the analysis you are uploading relates.
17 #[serde(rename = "commit_sha")]
18 pub commit_sha: String,
19 /// The full Git reference, formatted as `refs/heads/<branch name>`, `refs/tags/<tag>`, `refs/pull/<number>/merge`, or `refs/pull/<number>/head`.
20 #[serde(rename = "ref")]
21 pub r#ref: String,
22 /// A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [`gzip`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. For more information, see \"[SARIF support for code scanning](https://docs.github.com/code-security/secure-coding/sarif-support-for-code-scanning).\"
23 #[serde(rename = "sarif")]
24 pub sarif: String,
25 /// The base directory used in the analysis, as it appears in the SARIF file. This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository.
26 #[serde(rename = "checkout_uri", skip_serializing_if = "Option::is_none")]
27 pub checkout_uri: Option<String>,
28 /// The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
29 #[serde(rename = "started_at", skip_serializing_if = "Option::is_none")]
30 pub started_at: Option<String>,
31 /// The name of the tool used to generate the code scanning analysis. If this parameter is not used, the tool name defaults to \"API\". If the uploaded SARIF contains a tool GUID, this will be available for filtering using the `tool_guid` parameter of operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`.
32 #[serde(rename = "tool_name", skip_serializing_if = "Option::is_none")]
33 pub tool_name: Option<String>,
34 /// Whether the SARIF file will be validated according to the code scanning specifications. This parameter is intended to help integrators ensure that the uploaded SARIF files are correctly rendered by code scanning.
35 #[serde(rename = "validate", skip_serializing_if = "Option::is_none")]
36 pub validate: Option<bool>,
37}
38
39impl CodeScanningUploadSarifRequest {
40 pub fn new(commit_sha: String, r#ref: String, sarif: String) -> CodeScanningUploadSarifRequest {
41 CodeScanningUploadSarifRequest {
42 commit_sha,
43 r#ref,
44 sarif,
45 checkout_uri: None,
46 started_at: None,
47 tool_name: None,
48 validate: None,
49 }
50 }
51}
52