openapi_github/models/
license_content.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/// LicenseContent : License Content
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct LicenseContent {
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "path")]
20    pub path: String,
21    #[serde(rename = "sha")]
22    pub sha: String,
23    #[serde(rename = "size")]
24    pub size: i32,
25    #[serde(rename = "url")]
26    pub url: String,
27    #[serde(rename = "html_url", deserialize_with = "Option::deserialize")]
28    pub html_url: Option<String>,
29    #[serde(rename = "git_url", deserialize_with = "Option::deserialize")]
30    pub git_url: Option<String>,
31    #[serde(rename = "download_url", deserialize_with = "Option::deserialize")]
32    pub download_url: Option<String>,
33    #[serde(rename = "type")]
34    pub r#type: String,
35    #[serde(rename = "content")]
36    pub content: String,
37    #[serde(rename = "encoding")]
38    pub encoding: String,
39    #[serde(rename = "_links")]
40    pub _links: Box<models::ContentTreeEntriesInnerLinks>,
41    #[serde(rename = "license", deserialize_with = "Option::deserialize")]
42    pub license: Option<Box<models::NullableLicenseSimple>>,
43}
44
45impl LicenseContent {
46    /// License Content
47    pub fn new(name: String, path: String, sha: String, size: i32, url: String, html_url: Option<String>, git_url: Option<String>, download_url: Option<String>, r#type: String, content: String, encoding: String, _links: models::ContentTreeEntriesInnerLinks, license: Option<models::NullableLicenseSimple>) -> LicenseContent {
48        LicenseContent {
49            name,
50            path,
51            sha,
52            size,
53            url,
54            html_url,
55            git_url,
56            download_url,
57            r#type,
58            content,
59            encoding,
60            _links: Box::new(_links),
61            license: license.map(Box::new),
62        }
63    }
64}
65