openapi_github/models/
thread_subscription.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/// ThreadSubscription : Thread Subscription
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ThreadSubscription {
17    #[serde(rename = "subscribed")]
18    pub subscribed: bool,
19    #[serde(rename = "ignored")]
20    pub ignored: bool,
21    #[serde(rename = "reason", deserialize_with = "Option::deserialize")]
22    pub reason: Option<String>,
23    #[serde(rename = "created_at", deserialize_with = "Option::deserialize")]
24    pub created_at: Option<String>,
25    #[serde(rename = "url")]
26    pub url: String,
27    #[serde(rename = "thread_url", skip_serializing_if = "Option::is_none")]
28    pub thread_url: Option<String>,
29    #[serde(rename = "repository_url", skip_serializing_if = "Option::is_none")]
30    pub repository_url: Option<String>,
31}
32
33impl ThreadSubscription {
34    /// Thread Subscription
35    pub fn new(subscribed: bool, ignored: bool, reason: Option<String>, created_at: Option<String>, url: String) -> ThreadSubscription {
36        ThreadSubscription {
37            subscribed,
38            ignored,
39            reason,
40            created_at,
41            url,
42            thread_url: None,
43            repository_url: None,
44        }
45    }
46}
47