fastly_api/models/arc_create_virtual_key_response.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/// ArcCreateVirtualKeyResponse : The virtual key that was created, including its access token.
9
10
11
12#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
13pub struct ArcCreateVirtualKeyResponse {
14 /// The unique identifier of the virtual key.
15 #[serde(rename = "id")]
16 pub id: String,
17 /// The ID of the customer account that owns the key.
18 #[serde(rename = "customer_id")]
19 pub customer_id: String,
20 /// The display name of the virtual key.
21 #[serde(rename = "name")]
22 pub name: String,
23 /// The ID of the user who created the key.
24 #[serde(rename = "user_id")]
25 pub user_id: String,
26 /// The date and time the key expires, in RFC 3339 format. `null` if the key doesn't expire.
27 #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
28 pub expires_at: Option<String>,
29 /// The requests-per-minute limit for this key. `null` if there is no limit.
30 #[serde(rename = "rpm_limit", skip_serializing_if = "Option::is_none")]
31 pub rpm_limit: Option<i32>,
32 /// The tokens-per-minute limit for this key. `null` if there is no limit.
33 #[serde(rename = "tpm_limit", skip_serializing_if = "Option::is_none")]
34 pub tpm_limit: Option<i32>,
35 /// The date and time the key was created, in RFC 3339 format.
36 #[serde(rename = "created_at")]
37 pub created_at: String,
38 /// The date and time the key was last updated, in RFC 3339 format.
39 #[serde(rename = "updated_at")]
40 pub updated_at: String,
41 /// The access token for this virtual key. This is only returned when the key is created or rotated, and cannot be retrieved again afterward.
42 #[serde(rename = "access_token")]
43 pub access_token: String,
44}
45
46impl ArcCreateVirtualKeyResponse {
47 /// The virtual key that was created, including its access token.
48 pub fn new(id: String, customer_id: String, name: String, user_id: String, created_at: String, updated_at: String, access_token: String) -> ArcCreateVirtualKeyResponse {
49 ArcCreateVirtualKeyResponse {
50 id,
51 customer_id,
52 name,
53 user_id,
54 expires_at: None,
55 rpm_limit: None,
56 tpm_limit: None,
57 created_at,
58 updated_at,
59 access_token,
60 }
61 }
62}
63
64