openapi_github/models/
deploy_key.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/// DeployKey : An SSH key granting access to a single repository.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DeployKey {
17    #[serde(rename = "id")]
18    pub id: i32,
19    #[serde(rename = "key")]
20    pub key: String,
21    #[serde(rename = "url")]
22    pub url: String,
23    #[serde(rename = "title")]
24    pub title: String,
25    #[serde(rename = "verified")]
26    pub verified: bool,
27    #[serde(rename = "created_at")]
28    pub created_at: String,
29    #[serde(rename = "read_only")]
30    pub read_only: bool,
31    #[serde(rename = "added_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub added_by: Option<Option<String>>,
33    #[serde(rename = "last_used", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub last_used: Option<Option<String>>,
35}
36
37impl DeployKey {
38    /// An SSH key granting access to a single repository.
39    pub fn new(id: i32, key: String, url: String, title: String, verified: bool, created_at: String, read_only: bool) -> DeployKey {
40        DeployKey {
41            id,
42            key,
43            url,
44            title,
45            verified,
46            created_at,
47            read_only,
48            added_by: None,
49            last_used: None,
50        }
51    }
52}
53