openapi_github/models/
code_scanning_codeql_database.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/// CodeScanningCodeqlDatabase : A CodeQL database.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CodeScanningCodeqlDatabase {
17    /// The ID of the CodeQL database.
18    #[serde(rename = "id")]
19    pub id: i32,
20    /// The name of the CodeQL database.
21    #[serde(rename = "name")]
22    pub name: String,
23    /// The language of the CodeQL database.
24    #[serde(rename = "language")]
25    pub language: String,
26    #[serde(rename = "uploader")]
27    pub uploader: Box<models::SimpleUser>,
28    /// The MIME type of the CodeQL database file.
29    #[serde(rename = "content_type")]
30    pub content_type: String,
31    /// The size of the CodeQL database file in bytes.
32    #[serde(rename = "size")]
33    pub size: i32,
34    /// The date and time at which the CodeQL database was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
35    #[serde(rename = "created_at")]
36    pub created_at: String,
37    /// The date and time at which the CodeQL database was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
38    #[serde(rename = "updated_at")]
39    pub updated_at: String,
40    /// The URL at which to download the CodeQL database. The `Accept` header must be set to the value of the `content_type` property.
41    #[serde(rename = "url")]
42    pub url: String,
43    /// The commit SHA of the repository at the time the CodeQL database was created.
44    #[serde(rename = "commit_oid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
45    pub commit_oid: Option<Option<String>>,
46}
47
48impl CodeScanningCodeqlDatabase {
49    /// A CodeQL database.
50    pub fn new(id: i32, name: String, language: String, uploader: models::SimpleUser, content_type: String, size: i32, created_at: String, updated_at: String, url: String) -> CodeScanningCodeqlDatabase {
51        CodeScanningCodeqlDatabase {
52            id,
53            name,
54            language,
55            uploader: Box::new(uploader),
56            content_type,
57            size,
58            created_at,
59            updated_at,
60            url,
61            commit_oid: None,
62        }
63    }
64}
65