openapi_github/models/
issues_update_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 IssuesUpdateRequest {
16    #[serde(rename = "title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
17    pub title: Option<Option<Box<models::IssuesUpdateRequestTitle>>>,
18    /// The contents of the issue.
19    #[serde(rename = "body", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub body: Option<Option<String>>,
21    /// Username to assign to this issue. **This field is deprecated.**
22    #[serde(rename = "assignee", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub assignee: Option<Option<String>>,
24    /// The open or closed state of the issue.
25    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
26    pub state: Option<State>,
27    /// The reason for the state change. Ignored unless `state` is changed.
28    #[serde(rename = "state_reason", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub state_reason: Option<Option<StateReason>>,
30    #[serde(rename = "milestone", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub milestone: Option<Option<Box<models::IssuesUpdateRequestMilestone>>>,
32    /// Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped.
33    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
34    pub labels: Option<Vec<models::IssuesCreateRequestLabelsInner>>,
35    /// Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped.
36    #[serde(rename = "assignees", skip_serializing_if = "Option::is_none")]
37    pub assignees: Option<Vec<String>>,
38}
39
40impl IssuesUpdateRequest {
41    pub fn new() -> IssuesUpdateRequest {
42        IssuesUpdateRequest {
43            title: None,
44            body: None,
45            assignee: None,
46            state: None,
47            state_reason: None,
48            milestone: None,
49            labels: None,
50            assignees: None,
51        }
52    }
53}
54/// The open or closed state of the issue.
55#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
56pub enum State {
57    #[serde(rename = "open")]
58    Open,
59    #[serde(rename = "closed")]
60    Closed,
61}
62
63impl Default for State {
64    fn default() -> State {
65        Self::Open
66    }
67}
68/// The reason for the state change. Ignored unless `state` is changed.
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum StateReason {
71    #[serde(rename = "completed")]
72    Completed,
73    #[serde(rename = "not_planned")]
74    NotPlanned,
75    #[serde(rename = "reopened")]
76    Reopened,
77}
78
79impl Default for StateReason {
80    fn default() -> StateReason {
81        Self::Completed
82    }
83}
84