openapi_github/models/
repository_advisory_credit.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/// RepositoryAdvisoryCredit : A credit given to a user for a repository security advisory.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RepositoryAdvisoryCredit {
17    #[serde(rename = "user")]
18    pub user: Box<models::SimpleUser>,
19    #[serde(rename = "type")]
20    pub r#type: models::SecurityAdvisoryCreditTypes,
21    /// The state of the user's acceptance of the credit.
22    #[serde(rename = "state")]
23    pub state: State,
24}
25
26impl RepositoryAdvisoryCredit {
27    /// A credit given to a user for a repository security advisory.
28    pub fn new(user: models::SimpleUser, r#type: models::SecurityAdvisoryCreditTypes, state: State) -> RepositoryAdvisoryCredit {
29        RepositoryAdvisoryCredit {
30            user: Box::new(user),
31            r#type,
32            state,
33        }
34    }
35}
36/// The state of the user's acceptance of the credit.
37#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
38pub enum State {
39    #[serde(rename = "accepted")]
40    Accepted,
41    #[serde(rename = "declined")]
42    Declined,
43    #[serde(rename = "pending")]
44    Pending,
45}
46
47impl Default for State {
48    fn default() -> State {
49        Self::Accepted
50    }
51}
52