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