Skip to main content

akeyless_api/models/
create_certificate.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 CreateCertificate {
16    /// Content of the certificate in a Base64 format.
17    #[serde(rename = "certificate-data", skip_serializing_if = "Option::is_none")]
18    pub certificate_data: Option<String>,
19    /// Protection from accidental deletion of this object [true/false]
20    #[serde(rename = "delete_protection", skip_serializing_if = "Option::is_none")]
21    pub delete_protection: Option<String>,
22    /// Description of the object
23    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
24    pub description: Option<String>,
25    /// How many days before the expiration of the certificate would you like to be notified.
26    #[serde(rename = "expiration-event-in", skip_serializing_if = "Option::is_none")]
27    pub expiration_event_in: Option<Vec<String>>,
28    /// CertificateFormat of the certificate and private key, possible values: cer,crt,pem,pfx,p12. Required when passing inline certificate content with --certificate-data or --key-data, otherwise format is derived from the file extension.
29    #[serde(rename = "format", skip_serializing_if = "Option::is_none")]
30    pub format: Option<String>,
31    /// Additional custom fields to associate with the item
32    #[serde(rename = "item-custom-fields", skip_serializing_if = "Option::is_none")]
33    pub item_custom_fields: Option<std::collections::HashMap<String, String>>,
34    /// Set output format to JSON
35    #[serde(rename = "json", skip_serializing_if = "Option::is_none")]
36    pub json: Option<bool>,
37    /// The name of a key to use to encrypt the certificate's key (if empty, the account default protectionKey key will be used)
38    #[serde(rename = "key", skip_serializing_if = "Option::is_none")]
39    pub key: Option<String>,
40    /// Content of the certificate's private key in a Base64 format.
41    #[serde(rename = "key-data", skip_serializing_if = "Option::is_none")]
42    pub key_data: Option<String>,
43    /// Deprecated - use description
44    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
45    pub metadata: Option<String>,
46    /// Certificate name
47    #[serde(rename = "name")]
48    pub name: String,
49    /// Add tags attached to this object
50    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
51    pub tags: Option<Vec<String>>,
52    /// Authentication token (see `/auth` and `/configure`)
53    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
54    pub token: Option<String>,
55    /// The universal identity token, Required only for universal_identity authentication
56    #[serde(rename = "uid-token", skip_serializing_if = "Option::is_none")]
57    pub uid_token: Option<String>,
58}
59
60impl CreateCertificate {
61    pub fn new(name: String) -> CreateCertificate {
62        CreateCertificate {
63            certificate_data: None,
64            delete_protection: None,
65            description: None,
66            expiration_event_in: None,
67            format: None,
68            item_custom_fields: None,
69            json: None,
70            key: None,
71            key_data: None,
72            metadata: None,
73            name,
74            tags: None,
75            token: None,
76            uid_token: None,
77        }
78    }
79}
80