openapi-github 0.1.0

OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
Documentation
/*
 * 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
    }
}