openapi_github/models/code_scanning_analysis.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 CodeScanningAnalysis {
16 /// The Git reference, formatted as `refs/pull/<number>/merge`, `refs/pull/<number>/head`, `refs/heads/<branch name>` or simply `<branch name>`.
17 #[serde(rename = "ref")]
18 pub r#ref: String,
19 /// The SHA of the commit to which the analysis you are uploading relates.
20 #[serde(rename = "commit_sha")]
21 pub commit_sha: String,
22 /// Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name.
23 #[serde(rename = "analysis_key")]
24 pub analysis_key: String,
25 /// Identifies the variable values associated with the environment in which this analysis was performed.
26 #[serde(rename = "environment")]
27 pub environment: String,
28 /// 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.
29 #[serde(rename = "category", skip_serializing_if = "Option::is_none")]
30 pub category: Option<String>,
31 #[serde(rename = "error")]
32 pub error: String,
33 /// The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
34 #[serde(rename = "created_at")]
35 pub created_at: String,
36 /// The total number of results in the analysis.
37 #[serde(rename = "results_count")]
38 pub results_count: i32,
39 /// The total number of rules used in the analysis.
40 #[serde(rename = "rules_count")]
41 pub rules_count: i32,
42 /// Unique identifier for this analysis.
43 #[serde(rename = "id")]
44 pub id: i32,
45 /// The REST API URL of the analysis resource.
46 #[serde(rename = "url")]
47 pub url: String,
48 /// An identifier for the upload.
49 #[serde(rename = "sarif_id")]
50 pub sarif_id: String,
51 #[serde(rename = "tool")]
52 pub tool: Box<models::CodeScanningAnalysisTool>,
53 #[serde(rename = "deletable")]
54 pub deletable: bool,
55 /// Warning generated when processing the analysis
56 #[serde(rename = "warning")]
57 pub warning: String,
58}
59
60impl CodeScanningAnalysis {
61 pub fn new(r#ref: String, commit_sha: String, analysis_key: String, environment: String, error: String, created_at: String, results_count: i32, rules_count: i32, id: i32, url: String, sarif_id: String, tool: models::CodeScanningAnalysisTool, deletable: bool, warning: String) -> CodeScanningAnalysis {
62 CodeScanningAnalysis {
63 r#ref,
64 commit_sha,
65 analysis_key,
66 environment,
67 category: None,
68 error,
69 created_at,
70 results_count,
71 rules_count,
72 id,
73 url,
74 sarif_id,
75 tool: Box::new(tool),
76 deletable,
77 warning,
78 }
79 }
80}
81