Rewrite rust (#38)
Co-authored-by: kjuulh <contact@kjuulh.io> Reviewed-on: https://git.front.kjuulh.io/kjuulh/octopush/pulls/38
This commit is contained in:
39
crates/gitea_raw_client/src/models/create_key_option.rs
Normal file
39
crates/gitea_raw_client/src/models/create_key_option.rs
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Gitea API.
|
||||
*
|
||||
* This documentation describes the Gitea API.
|
||||
*
|
||||
* The version of the OpenAPI document: 1.17.3
|
||||
*
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/// CreateKeyOption : CreateKeyOption options when creating a key
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
|
||||
pub struct CreateKeyOption {
|
||||
/// An armored SSH key to add
|
||||
#[serde(rename = "key")]
|
||||
pub key: String,
|
||||
/// Describe if the key has only read access or read/write
|
||||
#[serde(rename = "read_only", skip_serializing_if = "Option::is_none")]
|
||||
pub read_only: Option<bool>,
|
||||
/// Title of the key to add
|
||||
#[serde(rename = "title")]
|
||||
pub title: String,
|
||||
}
|
||||
|
||||
impl CreateKeyOption {
|
||||
/// CreateKeyOption options when creating a key
|
||||
pub fn new(key: String, title: String) -> CreateKeyOption {
|
||||
CreateKeyOption {
|
||||
key,
|
||||
read_only: None,
|
||||
title,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user