openapi_github/models/
dependabot_update_alert_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 DependabotUpdateAlertRequest {
16    /// The state of the Dependabot alert. A `dismissed_reason` must be provided when setting the state to `dismissed`.
17    #[serde(rename = "state")]
18    pub state: State,
19    /// **Required when `state` is `dismissed`.** A reason for dismissing the alert.
20    #[serde(rename = "dismissed_reason", skip_serializing_if = "Option::is_none")]
21    pub dismissed_reason: Option<DismissedReason>,
22    /// An optional comment associated with dismissing the alert.
23    #[serde(rename = "dismissed_comment", skip_serializing_if = "Option::is_none")]
24    pub dismissed_comment: Option<String>,
25}
26
27impl DependabotUpdateAlertRequest {
28    pub fn new(state: State) -> DependabotUpdateAlertRequest {
29        DependabotUpdateAlertRequest {
30            state,
31            dismissed_reason: None,
32            dismissed_comment: None,
33        }
34    }
35}
36/// The state of the Dependabot alert. A `dismissed_reason` must be provided when setting the state to `dismissed`.
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum State {
39    #[serde(rename = "dismissed")]
40    Dismissed,
41    #[serde(rename = "open")]
42    Open,
43}
44
45impl Default for State {
46    fn default() -> State {
47        Self::Dismissed
48    }
49}
50/// **Required when `state` is `dismissed`.** A reason for dismissing the alert.
51#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
52pub enum DismissedReason {
53    #[serde(rename = "fix_started")]
54    FixStarted,
55    #[serde(rename = "inaccurate")]
56    Inaccurate,
57    #[serde(rename = "no_bandwidth")]
58    NoBandwidth,
59    #[serde(rename = "not_used")]
60    NotUsed,
61    #[serde(rename = "tolerable_risk")]
62    TolerableRisk,
63}
64
65impl Default for DismissedReason {
66    fn default() -> DismissedReason {
67        Self::FixStarted
68    }
69}
70