openapi_github/models/
checks_create_request_output_annotations_inner.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 ChecksCreateRequestOutputAnnotationsInner {
16    /// The path of the file to add an annotation to. For example, `assets/css/main.css`.
17    #[serde(rename = "path")]
18    pub path: String,
19    /// The start line of the annotation. Line numbers start at 1.
20    #[serde(rename = "start_line")]
21    pub start_line: i32,
22    /// The end line of the annotation.
23    #[serde(rename = "end_line")]
24    pub end_line: i32,
25    /// 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.
26    #[serde(rename = "start_column", skip_serializing_if = "Option::is_none")]
27    pub start_column: Option<i32>,
28    /// 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.
29    #[serde(rename = "end_column", skip_serializing_if = "Option::is_none")]
30    pub end_column: Option<i32>,
31    /// The level of the annotation.
32    #[serde(rename = "annotation_level")]
33    pub annotation_level: AnnotationLevel,
34    /// A short description of the feedback for these lines of code. The maximum size is 64 KB.
35    #[serde(rename = "message")]
36    pub message: String,
37    /// The title that represents the annotation. The maximum size is 255 characters.
38    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
39    pub title: Option<String>,
40    /// Details about this annotation. The maximum size is 64 KB.
41    #[serde(rename = "raw_details", skip_serializing_if = "Option::is_none")]
42    pub raw_details: Option<String>,
43}
44
45impl ChecksCreateRequestOutputAnnotationsInner {
46    pub fn new(path: String, start_line: i32, end_line: i32, annotation_level: AnnotationLevel, message: String) -> ChecksCreateRequestOutputAnnotationsInner {
47        ChecksCreateRequestOutputAnnotationsInner {
48            path,
49            start_line,
50            end_line,
51            start_column: None,
52            end_column: None,
53            annotation_level,
54            message,
55            title: None,
56            raw_details: None,
57        }
58    }
59}
60/// The level of the annotation.
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum AnnotationLevel {
63    #[serde(rename = "notice")]
64    Notice,
65    #[serde(rename = "warning")]
66    Warning,
67    #[serde(rename = "failure")]
68    Failure,
69}
70
71impl Default for AnnotationLevel {
72    fn default() -> AnnotationLevel {
73        Self::Notice
74    }
75}
76