openapi_github/models/
thread.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/// Thread : Thread
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Thread {
17    #[serde(rename = "id")]
18    pub id: String,
19    #[serde(rename = "repository")]
20    pub repository: Box<models::MinimalRepository>,
21    #[serde(rename = "subject")]
22    pub subject: Box<models::ThreadSubject>,
23    #[serde(rename = "reason")]
24    pub reason: String,
25    #[serde(rename = "unread")]
26    pub unread: bool,
27    #[serde(rename = "updated_at")]
28    pub updated_at: String,
29    #[serde(rename = "last_read_at", deserialize_with = "Option::deserialize")]
30    pub last_read_at: Option<String>,
31    #[serde(rename = "url")]
32    pub url: String,
33    #[serde(rename = "subscription_url")]
34    pub subscription_url: String,
35}
36
37impl Thread {
38    /// Thread
39    pub fn new(id: String, repository: models::MinimalRepository, subject: models::ThreadSubject, reason: String, unread: bool, updated_at: String, last_read_at: Option<String>, url: String, subscription_url: String) -> Thread {
40        Thread {
41            id,
42            repository: Box::new(repository),
43            subject: Box::new(subject),
44            reason,
45            unread,
46            updated_at,
47            last_read_at,
48            url,
49            subscription_url,
50        }
51    }
52}
53