openapi_github/models/
interaction_expiry.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/// InteractionExpiry : The duration of the interaction restriction. Default: `one_day`.
15/// The duration of the interaction restriction. Default: `one_day`.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum InteractionExpiry {
18    #[serde(rename = "one_day")]
19    OneDay,
20    #[serde(rename = "three_days")]
21    ThreeDays,
22    #[serde(rename = "one_week")]
23    OneWeek,
24    #[serde(rename = "one_month")]
25    OneMonth,
26    #[serde(rename = "six_months")]
27    SixMonths,
28
29}
30
31impl std::fmt::Display for InteractionExpiry {
32    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
33        match self {
34            Self::OneDay => write!(f, "one_day"),
35            Self::ThreeDays => write!(f, "three_days"),
36            Self::OneWeek => write!(f, "one_week"),
37            Self::OneMonth => write!(f, "one_month"),
38            Self::SixMonths => write!(f, "six_months"),
39        }
40    }
41}
42
43impl Default for InteractionExpiry {
44    fn default() -> InteractionExpiry {
45        Self::OneDay
46    }
47}
48