fastly_api/models/tls_csr_data_attributes.rs
1/*
2 * Fastly API
3 *
4 * Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/)
5 *
6 */
7
8
9
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct TlsCsrDataAttributes {
13 /// Subject Alternate Names - An array of one or more fully qualified domain names or public IP addresses to be secured by this certificate. Required.
14 #[serde(rename = "sans")]
15 pub sans: Vec<String>,
16 /// Common Name (CN) - The fully qualified domain name (FQDN) to be secured by this certificate. The common name should be one of the entries in the SANs parameter.
17 #[serde(rename = "common_name", skip_serializing_if = "Option::is_none")]
18 pub common_name: Option<String>,
19 /// Country (C) - The two-letter ISO country code where the organization is located.
20 #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
21 pub country: Option<String>,
22 /// State (S) - The state, province, region, or county where the organization is located. This should not be abbreviated.
23 #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
24 pub state: Option<String>,
25 /// Locality (L) - The locality, city, town, or village where the organization is located.
26 #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
27 pub city: Option<String>,
28 /// Postal Code - The postal code where the organization is located.
29 #[serde(rename = "postal_code", skip_serializing_if = "Option::is_none")]
30 pub postal_code: Option<String>,
31 /// Street Address - The street address where the organization is located.
32 #[serde(rename = "street_address", skip_serializing_if = "Option::is_none")]
33 pub street_address: Option<String>,
34 /// Organization (O) - The legal name of the organization, including any suffixes. This should not be abbreviated.
35 #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
36 pub organization: Option<String>,
37 /// Organizational Unit (OU) - The internal division of the organization managing the certificate.
38 #[serde(rename = "organizational_unit", skip_serializing_if = "Option::is_none")]
39 pub organizational_unit: Option<String>,
40 /// Email Address (EMAIL) - The organizational contact for this.
41 #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
42 pub email: Option<String>,
43 /// CSR Key Type.
44 #[serde(rename = "key_type", skip_serializing_if = "Option::is_none")]
45 pub key_type: Option<KeyType>,
46}
47
48impl TlsCsrDataAttributes {
49 pub fn new(sans: Vec<String>) -> TlsCsrDataAttributes {
50 TlsCsrDataAttributes {
51 sans,
52 common_name: None,
53 country: None,
54 state: None,
55 city: None,
56 postal_code: None,
57 street_address: None,
58 organization: None,
59 organizational_unit: None,
60 email: None,
61 key_type: None,
62 }
63 }
64}
65
66/// CSR Key Type.
67#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
68pub enum KeyType {
69 #[serde(rename = "RSA2048")]
70 RSA2048,
71 #[serde(rename = "ECDSA256")]
72 ECDSA256,
73}
74
75impl Default for KeyType {
76 fn default() -> KeyType {
77 Self::RSA2048
78 }
79}
80