openapi_github/models/
nullable_license_simple.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/// NullableLicenseSimple : License Simple
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NullableLicenseSimple {
17    #[serde(rename = "key")]
18    pub key: String,
19    #[serde(rename = "name")]
20    pub name: String,
21    #[serde(rename = "url", deserialize_with = "Option::deserialize")]
22    pub url: Option<String>,
23    #[serde(rename = "spdx_id", deserialize_with = "Option::deserialize")]
24    pub spdx_id: Option<String>,
25    #[serde(rename = "node_id")]
26    pub node_id: String,
27    #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")]
28    pub html_url: Option<String>,
29}
30
31impl NullableLicenseSimple {
32    /// License Simple
33    pub fn new(key: String, name: String, url: Option<String>, spdx_id: Option<String>, node_id: String) -> NullableLicenseSimple {
34        NullableLicenseSimple {
35            key,
36            name,
37            url,
38            spdx_id,
39            node_id,
40            html_url: None,
41        }
42    }
43}
44