openapi_github/models/
community_profile_files.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CommunityProfileFiles {
16    #[serde(rename = "code_of_conduct", deserialize_with = "Option::deserialize")]
17    pub code_of_conduct: Option<Box<models::NullableCodeOfConductSimple>>,
18    #[serde(rename = "code_of_conduct_file", deserialize_with = "Option::deserialize")]
19    pub code_of_conduct_file: Option<Box<models::NullableCommunityHealthFile>>,
20    #[serde(rename = "license", deserialize_with = "Option::deserialize")]
21    pub license: Option<Box<models::NullableLicenseSimple>>,
22    #[serde(rename = "contributing", deserialize_with = "Option::deserialize")]
23    pub contributing: Option<Box<models::NullableCommunityHealthFile>>,
24    #[serde(rename = "readme", deserialize_with = "Option::deserialize")]
25    pub readme: Option<Box<models::NullableCommunityHealthFile>>,
26    #[serde(rename = "issue_template", deserialize_with = "Option::deserialize")]
27    pub issue_template: Option<Box<models::NullableCommunityHealthFile>>,
28    #[serde(rename = "pull_request_template", deserialize_with = "Option::deserialize")]
29    pub pull_request_template: Option<Box<models::NullableCommunityHealthFile>>,
30}
31
32impl CommunityProfileFiles {
33    pub fn new(code_of_conduct: Option<models::NullableCodeOfConductSimple>, code_of_conduct_file: Option<models::NullableCommunityHealthFile>, license: Option<models::NullableLicenseSimple>, contributing: Option<models::NullableCommunityHealthFile>, readme: Option<models::NullableCommunityHealthFile>, issue_template: Option<models::NullableCommunityHealthFile>, pull_request_template: Option<models::NullableCommunityHealthFile>) -> CommunityProfileFiles {
34        CommunityProfileFiles {
35            code_of_conduct: code_of_conduct.map(Box::new),
36            code_of_conduct_file: code_of_conduct_file.map(Box::new),
37            license: license.map(Box::new),
38            contributing: contributing.map(Box::new),
39            readme: readme.map(Box::new),
40            issue_template: issue_template.map(Box::new),
41            pull_request_template: pull_request_template.map(Box::new),
42        }
43    }
44}
45