Skip to main content

akeyless_api/models/
create_classic_key.rs

1/*
2 * Akeyless API
3 *
4 * The purpose of this application is to provide access to Akeyless API.
5 *
6 * The version of the OpenAPI document: 3.0
7 * Contact: support@akeyless.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// CreateClassicKey : CreateClassicKey is a command that creates classic key
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CreateClassicKey {
17    /// Classic Key type; options: [AES128GCM, AES256GCM, AES128SIV, AES256SIV, RSA1024, RSA2048, RSA3072, RSA4096, EC256, EC384, GPG]
18    #[serde(rename = "alg")]
19    pub alg: String,
20    /// Whether to automatically rotate every rotation_interval days, or disable existing automatic rotation [true/false]
21    #[serde(rename = "auto-rotate", skip_serializing_if = "Option::is_none")]
22    pub auto_rotate: Option<String>,
23    /// Certificate in a PEM format.
24    #[serde(rename = "cert-file-data", skip_serializing_if = "Option::is_none")]
25    pub cert_file_data: Option<String>,
26    /// Common name for the generated certificate. Relevant only for generate-self-signed-certificate.
27    #[serde(rename = "certificate-common-name", skip_serializing_if = "Option::is_none")]
28    pub certificate_common_name: Option<String>,
29    /// Country name for the generated certificate. Relevant only for generate-self-signed-certificate.
30    #[serde(rename = "certificate-country", skip_serializing_if = "Option::is_none")]
31    pub certificate_country: Option<String>,
32    /// Digest algorithm to be used for the certificate key signing.
33    #[serde(rename = "certificate-digest-algo", skip_serializing_if = "Option::is_none")]
34    pub certificate_digest_algo: Option<String>,
35    #[serde(rename = "certificate-format", skip_serializing_if = "Option::is_none")]
36    pub certificate_format: Option<String>,
37    /// Locality for the generated certificate. Relevant only for generate-self-signed-certificate.
38    #[serde(rename = "certificate-locality", skip_serializing_if = "Option::is_none")]
39    pub certificate_locality: Option<String>,
40    /// Organization name for the generated certificate. Relevant only for generate-self-signed-certificate.
41    #[serde(rename = "certificate-organization", skip_serializing_if = "Option::is_none")]
42    pub certificate_organization: Option<String>,
43    /// Province name for the generated certificate. Relevant only for generate-self-signed-certificate.
44    #[serde(rename = "certificate-province", skip_serializing_if = "Option::is_none")]
45    pub certificate_province: Option<String>,
46    /// TTL in days for the generated certificate. Required only for generate-self-signed-certificate.
47    #[serde(rename = "certificate-ttl", skip_serializing_if = "Option::is_none")]
48    pub certificate_ttl: Option<i64>,
49    /// The csr config data in base64 encoding
50    #[serde(rename = "conf-file-data", skip_serializing_if = "Option::is_none")]
51    pub conf_file_data: Option<String>,
52    /// Protection from accidental deletion of this object [true/false]
53    #[serde(rename = "delete_protection", skip_serializing_if = "Option::is_none")]
54    pub delete_protection: Option<String>,
55    /// Description of the object
56    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
57    pub description: Option<String>,
58    /// How many days before the expiration of the certificate would you like to be notified.
59    #[serde(rename = "expiration-event-in", skip_serializing_if = "Option::is_none")]
60    pub expiration_event_in: Option<Vec<String>>,
61    /// Whether to generate a self signed certificate with the key. If set, --certificate-ttl must be provided.
62    #[serde(rename = "generate-self-signed-certificate", skip_serializing_if = "Option::is_none")]
63    pub generate_self_signed_certificate: Option<bool>,
64    /// gpg alg: Relevant only if GPG key type selected; options: [RSA1024, RSA2048, RSA3072, RSA4096, Ed25519]
65    #[serde(rename = "gpg-alg", skip_serializing_if = "Option::is_none")]
66    pub gpg_alg: Option<String>,
67    /// Specifies the hash algorithm used for the encryption key's operations, available options: [SHA256, SHA384, SHA512]
68    #[serde(rename = "hash-algorithm", skip_serializing_if = "Option::is_none")]
69    pub hash_algorithm: Option<String>,
70    /// Additional custom fields to associate with the item
71    #[serde(rename = "item-custom-fields", skip_serializing_if = "Option::is_none")]
72    pub item_custom_fields: Option<std::collections::HashMap<String, String>>,
73    /// Set output format to JSON
74    #[serde(rename = "json", skip_serializing_if = "Option::is_none")]
75    pub json: Option<bool>,
76    /// Base64-encoded classic key value
77    #[serde(rename = "key-data", skip_serializing_if = "Option::is_none")]
78    pub key_data: Option<String>,
79    /// Deprecated - use description
80    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
81    pub metadata: Option<String>,
82    /// ClassicKey name
83    #[serde(rename = "name")]
84    pub name: String,
85    /// The name of a key that used to encrypt the secret value (if empty, the account default protectionKey key will be used)
86    #[serde(rename = "protection-key-name", skip_serializing_if = "Option::is_none")]
87    pub protection_key_name: Option<String>,
88    /// How many days before the rotation of the item would you like to be notified
89    #[serde(rename = "rotation-event-in", skip_serializing_if = "Option::is_none")]
90    pub rotation_event_in: Option<Vec<String>>,
91    /// The number of days to wait between every automatic rotation (1-365)
92    #[serde(rename = "rotation-interval", skip_serializing_if = "Option::is_none")]
93    pub rotation_interval: Option<String>,
94    /// Add tags attached to this object
95    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
96    pub tags: Option<Vec<String>>,
97    /// Authentication token (see `/auth` and `/configure`)
98    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
99    pub token: Option<String>,
100    /// The universal identity token, Required only for universal_identity authentication
101    #[serde(rename = "uid-token", skip_serializing_if = "Option::is_none")]
102    pub uid_token: Option<String>,
103}
104
105impl CreateClassicKey {
106    /// CreateClassicKey is a command that creates classic key
107    pub fn new(alg: String, name: String) -> CreateClassicKey {
108        CreateClassicKey {
109            alg,
110            auto_rotate: None,
111            cert_file_data: None,
112            certificate_common_name: None,
113            certificate_country: None,
114            certificate_digest_algo: None,
115            certificate_format: None,
116            certificate_locality: None,
117            certificate_organization: None,
118            certificate_province: None,
119            certificate_ttl: None,
120            conf_file_data: None,
121            delete_protection: None,
122            description: None,
123            expiration_event_in: None,
124            generate_self_signed_certificate: None,
125            gpg_alg: None,
126            hash_algorithm: None,
127            item_custom_fields: None,
128            json: None,
129            key_data: None,
130            metadata: None,
131            name,
132            protection_key_name: None,
133            rotation_event_in: None,
134            rotation_interval: None,
135            tags: None,
136            token: None,
137            uid_token: None,
138        }
139    }
140}
141