gitea_rs/models/create_key_option.rs
1/*
2 * Gitea API.
3 *
4 * This documentation describes the Gitea API.
5 *
6 * The version of the OpenAPI document: 1.19.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// CreateKeyOption : CreateKeyOption options when creating a key
12
13
14
15#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
16pub struct CreateKeyOption {
17 /// An armored SSH key to add
18 #[serde(rename = "key")]
19 pub key: String,
20 /// Describe if the key has only read access or read/write
21 #[serde(rename = "read_only", skip_serializing_if = "Option::is_none")]
22 pub read_only: Option<bool>,
23 /// Title of the key to add
24 #[serde(rename = "title")]
25 pub title: String,
26}
27
28impl CreateKeyOption {
29 /// CreateKeyOption options when creating a key
30 pub fn new(key: String, title: String) -> CreateKeyOption {
31 CreateKeyOption {
32 key,
33 read_only: None,
34 title,
35 }
36 }
37}
38
39