openapi_github/models/
webhook_gollum_pages_inner.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 WebhookGollumPagesInner {
16    /// The action that was performed on the page. Can be `created` or `edited`.
17    #[serde(rename = "action")]
18    pub action: Action,
19    /// Points to the HTML wiki page.
20    #[serde(rename = "html_url")]
21    pub html_url: String,
22    /// The name of the page.
23    #[serde(rename = "page_name")]
24    pub page_name: String,
25    /// The latest commit SHA of the page.
26    #[serde(rename = "sha")]
27    pub sha: String,
28    #[serde(rename = "summary", deserialize_with = "Option::deserialize")]
29    pub summary: Option<String>,
30    /// The current page title.
31    #[serde(rename = "title")]
32    pub title: String,
33}
34
35impl WebhookGollumPagesInner {
36    pub fn new(action: Action, html_url: String, page_name: String, sha: String, summary: Option<String>, title: String) -> WebhookGollumPagesInner {
37        WebhookGollumPagesInner {
38            action,
39            html_url,
40            page_name,
41            sha,
42            summary,
43            title,
44        }
45    }
46}
47/// The action that was performed on the page. Can be `created` or `edited`.
48#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
49pub enum Action {
50    #[serde(rename = "created")]
51    Created,
52    #[serde(rename = "edited")]
53    Edited,
54}
55
56impl Default for Action {
57    fn default() -> Action {
58        Self::Created
59    }
60}
61