openapi_github/models/
issues_lock_request.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 IssuesLockRequest {
16    /// The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons:    * `off-topic`    * `too heated`    * `resolved`    * `spam`
17    #[serde(rename = "lock_reason", skip_serializing_if = "Option::is_none")]
18    pub lock_reason: Option<LockReason>,
19}
20
21impl IssuesLockRequest {
22    pub fn new() -> IssuesLockRequest {
23        IssuesLockRequest {
24            lock_reason: None,
25        }
26    }
27}
28/// The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons:    * `off-topic`    * `too heated`    * `resolved`    * `spam`
29#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
30pub enum LockReason {
31    #[serde(rename = "off-topic")]
32    OffTopic,
33    #[serde(rename = "too heated")]
34    TooHeated,
35    #[serde(rename = "resolved")]
36    Resolved,
37    #[serde(rename = "spam")]
38    Spam,
39}
40
41impl Default for LockReason {
42    fn default() -> LockReason {
43        Self::OffTopic
44    }
45}
46