1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* Hetzner Cloud API
*
* Copied from the official API documentation for the Public Hetzner Cloud.
*
* The version of the OpenAPI document: 0.28.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// CreateCertificateRequest : Request for POST https://api.hetzner.cloud/v1/certificates
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateCertificateRequest {
/// Certificate and chain in PEM format, in order so that each record directly certifies the one preceding. Required for type `uploaded` Certificates.
#[serde(rename = "certificate", skip_serializing_if = "Option::is_none")]
pub certificate: Option<String>,
/// Domains and subdomains that should be contained in the Certificate issued by *Let's Encrypt*. Required for type `managed` Certificates.
#[serde(rename = "domain_names", skip_serializing_if = "Option::is_none")]
pub domain_names: Option<Vec<String>>,
/// User-defined labels (`key/value` pairs) for the Resource. For more information, see \"Labels\". | User-defined labels (`key/value` pairs) for the Resource. Note that the set of Labels provided in the request will overwrite the existing one. For more information, see \"Labels\".
#[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
pub labels: Option<std::collections::HashMap<String, String>>,
/// Name of the Certificate.
#[serde(rename = "name")]
pub name: String,
/// Certificate key in PEM format. Required for type `uploaded` Certificates.
#[serde(rename = "private_key", skip_serializing_if = "Option::is_none")]
pub private_key: Option<String>,
/// Choose between uploading a Certificate in PEM format or requesting a managed *Let's Encrypt* Certificate.
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<Type>,
}
impl CreateCertificateRequest {
/// Request for POST https://api.hetzner.cloud/v1/certificates
pub fn new(name: String) -> CreateCertificateRequest {
CreateCertificateRequest {
certificate: None,
domain_names: None,
labels: None,
name,
private_key: None,
r#type: None,
}
}
}
/// Choose between uploading a Certificate in PEM format or requesting a managed *Let's Encrypt* Certificate.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "managed")]
Managed,
#[serde(rename = "uploaded")]
Uploaded,
}
impl Default for Type {
fn default() -> Type {
Self::Managed
}
}