1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* GitHub's official OpenAPI spec + Octokit extension
*
* OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
*
* The version of the OpenAPI document: 16.6.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChecksCreateRequestOutputAnnotationsInner {
/// The path of the file to add an annotation to. For example, `assets/css/main.css`.
#[serde(rename = "path")]
pub path: String,
/// The start line of the annotation. Line numbers start at 1.
#[serde(rename = "start_line")]
pub start_line: i32,
/// The end line of the annotation.
#[serde(rename = "end_line")]
pub end_line: i32,
/// The start column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values. Column numbers start at 1.
#[serde(rename = "start_column", skip_serializing_if = "Option::is_none")]
pub start_column: Option<i32>,
/// The end column of the annotation. Annotations only support `start_column` and `end_column` on the same line. Omit this parameter if `start_line` and `end_line` have different values.
#[serde(rename = "end_column", skip_serializing_if = "Option::is_none")]
pub end_column: Option<i32>,
/// The level of the annotation.
#[serde(rename = "annotation_level")]
pub annotation_level: AnnotationLevel,
/// A short description of the feedback for these lines of code. The maximum size is 64 KB.
#[serde(rename = "message")]
pub message: String,
/// The title that represents the annotation. The maximum size is 255 characters.
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
/// Details about this annotation. The maximum size is 64 KB.
#[serde(rename = "raw_details", skip_serializing_if = "Option::is_none")]
pub raw_details: Option<String>,
}
impl ChecksCreateRequestOutputAnnotationsInner {
pub fn new(path: String, start_line: i32, end_line: i32, annotation_level: AnnotationLevel, message: String) -> ChecksCreateRequestOutputAnnotationsInner {
ChecksCreateRequestOutputAnnotationsInner {
path,
start_line,
end_line,
start_column: None,
end_column: None,
annotation_level,
message,
title: None,
raw_details: None,
}
}
}
/// The level of the annotation.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AnnotationLevel {
#[serde(rename = "notice")]
Notice,
#[serde(rename = "warning")]
Warning,
#[serde(rename = "failure")]
Failure,
}
impl Default for AnnotationLevel {
fn default() -> AnnotationLevel {
Self::Notice
}
}