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