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};

/// CodeSearchResultItem : Code Search Result Item
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CodeSearchResultItem {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "path")]
    pub path: String,
    #[serde(rename = "sha")]
    pub sha: String,
    #[serde(rename = "url")]
    pub url: String,
    #[serde(rename = "git_url")]
    pub git_url: String,
    #[serde(rename = "html_url")]
    pub html_url: String,
    #[serde(rename = "repository")]
    pub repository: Box<models::MinimalRepository>,
    #[serde(rename = "score")]
    pub score: f64,
    #[serde(rename = "file_size", skip_serializing_if = "Option::is_none")]
    pub file_size: Option<i32>,
    #[serde(rename = "language", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub language: Option<Option<String>>,
    #[serde(rename = "last_modified_at", skip_serializing_if = "Option::is_none")]
    pub last_modified_at: Option<String>,
    #[serde(rename = "line_numbers", skip_serializing_if = "Option::is_none")]
    pub line_numbers: Option<Vec<String>>,
    #[serde(rename = "text_matches", skip_serializing_if = "Option::is_none")]
    pub text_matches: Option<Vec<models::SearchResultTextMatchesInner>>,
}

impl CodeSearchResultItem {
    /// Code Search Result Item
    pub fn new(name: String, path: String, sha: String, url: String, git_url: String, html_url: String, repository: models::MinimalRepository, score: f64) -> CodeSearchResultItem {
        CodeSearchResultItem {
            name,
            path,
            sha,
            url,
            git_url,
            html_url,
            repository: Box::new(repository),
            score,
            file_size: None,
            language: None,
            last_modified_at: None,
            line_numbers: None,
            text_matches: None,
        }
    }
}