Skip to main content

akeyless_api/models/
create_dfc_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CreateDfcKey {
16    /// DFCKey type; options: [AES128GCM, AES256GCM, AES128SIV, AES256SIV, AES128CBC, AES256CBC, RSA1024, RSA2048, RSA3072, RSA4096]
17    #[serde(rename = "alg")]
18    pub alg: String,
19    /// Whether to automatically rotate every rotation_interval days, or disable existing automatic rotation [true/false]
20    #[serde(rename = "auto-rotate", skip_serializing_if = "Option::is_none")]
21    pub auto_rotate: Option<String>,
22    /// Common name for the generated certificate. Relevant only for generate-self-signed-certificate.
23    #[serde(rename = "certificate-common-name", skip_serializing_if = "Option::is_none")]
24    pub certificate_common_name: Option<String>,
25    /// Country name for the generated certificate. Relevant only for generate-self-signed-certificate.
26    #[serde(rename = "certificate-country", skip_serializing_if = "Option::is_none")]
27    pub certificate_country: Option<String>,
28    /// Digest algorithm to be used for the certificate key signing.
29    #[serde(rename = "certificate-digest-algo", skip_serializing_if = "Option::is_none")]
30    pub certificate_digest_algo: Option<String>,
31    #[serde(rename = "certificate-format", skip_serializing_if = "Option::is_none")]
32    pub certificate_format: Option<String>,
33    /// Locality for the generated certificate. Relevant only for generate-self-signed-certificate.
34    #[serde(rename = "certificate-locality", skip_serializing_if = "Option::is_none")]
35    pub certificate_locality: Option<String>,
36    /// Organization name for the generated certificate. Relevant only for generate-self-signed-certificate.
37    #[serde(rename = "certificate-organization", skip_serializing_if = "Option::is_none")]
38    pub certificate_organization: Option<String>,
39    /// Province name for the generated certificate. Relevant only for generate-self-signed-certificate.
40    #[serde(rename = "certificate-province", skip_serializing_if = "Option::is_none")]
41    pub certificate_province: Option<String>,
42    /// TTL in days for the generated certificate. Required only for generate-self-signed-certificate.
43    #[serde(rename = "certificate-ttl", skip_serializing_if = "Option::is_none")]
44    pub certificate_ttl: Option<i64>,
45    /// The csr config data in base64 encoding
46    #[serde(rename = "conf-file-data", skip_serializing_if = "Option::is_none")]
47    pub conf_file_data: Option<String>,
48    /// The customer fragment ID that will be used to create the DFC key (if empty, the key will be created independently of a customer fragment)
49    #[serde(rename = "customer-frg-id", skip_serializing_if = "Option::is_none")]
50    pub customer_frg_id: Option<String>,
51    /// Protection from accidental deletion of this object [true/false]
52    #[serde(rename = "delete_protection", skip_serializing_if = "Option::is_none")]
53    pub delete_protection: Option<String>,
54    /// Description of the object
55    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
56    pub description: Option<String>,
57    /// How many days before the expiration of the certificate would you like to be notified.
58    #[serde(rename = "expiration-event-in", skip_serializing_if = "Option::is_none")]
59    pub expiration_event_in: Option<Vec<String>>,
60    /// Whether to generate a self signed certificate with the key. If set, --certificate-ttl must be provided.
61    #[serde(rename = "generate-self-signed-certificate", skip_serializing_if = "Option::is_none")]
62    pub generate_self_signed_certificate: Option<bool>,
63    /// Specifies the hash algorithm used for the encryption key's operations, available options: [SHA256, SHA384, SHA512]
64    #[serde(rename = "hash-algorithm", skip_serializing_if = "Option::is_none")]
65    pub hash_algorithm: Option<String>,
66    /// Additional custom fields to associate with the item
67    #[serde(rename = "item-custom-fields", skip_serializing_if = "Option::is_none")]
68    pub item_custom_fields: Option<std::collections::HashMap<String, String>>,
69    /// Set output format to JSON
70    #[serde(rename = "json", skip_serializing_if = "Option::is_none")]
71    pub json: Option<bool>,
72    /// Deprecated - use description
73    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
74    pub metadata: Option<String>,
75    /// DFCKey name
76    #[serde(rename = "name")]
77    pub name: String,
78    /// How many days before the rotation of the item would you like to be notified
79    #[serde(rename = "rotation-event-in", skip_serializing_if = "Option::is_none")]
80    pub rotation_event_in: Option<Vec<String>>,
81    /// The number of days to wait between every automatic rotation (7-365)
82    #[serde(rename = "rotation-interval", skip_serializing_if = "Option::is_none")]
83    pub rotation_interval: Option<String>,
84    /// The number of fragments that the item will be split into (not includes customer fragment)
85    #[serde(rename = "split-level", skip_serializing_if = "Option::is_none")]
86    pub split_level: Option<i64>,
87    /// List of the tags attached to this DFC key
88    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
89    pub tag: Option<Vec<String>>,
90    /// Authentication token (see `/auth` and `/configure`)
91    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
92    pub token: Option<String>,
93    /// The universal identity token, Required only for universal_identity authentication
94    #[serde(rename = "uid-token", skip_serializing_if = "Option::is_none")]
95    pub uid_token: Option<String>,
96}
97
98impl CreateDfcKey {
99    pub fn new(alg: String, name: String) -> CreateDfcKey {
100        CreateDfcKey {
101            alg,
102            auto_rotate: None,
103            certificate_common_name: None,
104            certificate_country: None,
105            certificate_digest_algo: None,
106            certificate_format: None,
107            certificate_locality: None,
108            certificate_organization: None,
109            certificate_province: None,
110            certificate_ttl: None,
111            conf_file_data: None,
112            customer_frg_id: None,
113            delete_protection: None,
114            description: None,
115            expiration_event_in: None,
116            generate_self_signed_certificate: None,
117            hash_algorithm: None,
118            item_custom_fields: None,
119            json: None,
120            metadata: None,
121            name,
122            rotation_event_in: None,
123            rotation_interval: None,
124            split_level: None,
125            tag: None,
126            token: None,
127            uid_token: None,
128        }
129    }
130}
131