openapi_github/models/
repos_create_deploy_key_request.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ReposCreateDeployKeyRequest {
16    /// A name for the key.
17    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
18    pub title: Option<String>,
19    /// The contents of the key.
20    #[serde(rename = "key")]
21    pub key: String,
22    /// If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write.      Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see \"[Repository permission levels for an organization](https://docs.github.com/articles/repository-permission-levels-for-an-organization/)\" and \"[Permission levels for a user account repository](https://docs.github.com/articles/permission-levels-for-a-user-account-repository/).\"
23    #[serde(rename = "read_only", skip_serializing_if = "Option::is_none")]
24    pub read_only: Option<bool>,
25}
26
27impl ReposCreateDeployKeyRequest {
28    pub fn new(key: String) -> ReposCreateDeployKeyRequest {
29        ReposCreateDeployKeyRequest {
30            title: None,
31            key,
32            read_only: None,
33        }
34    }
35}
36