Skip to main content

fastly_api/models/
arc_rotate_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/// ArcRotateVirtualKeyResponse : The virtual key that was rotated, including its new access token.
9
10
11
12#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
13pub struct ArcRotateVirtualKeyResponse {
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 date and time the key was created, in RFC 3339 format.
30    #[serde(rename = "created_at")]
31    pub created_at: String,
32    /// The date and time the key was last updated, in RFC 3339 format.
33    #[serde(rename = "updated_at")]
34    pub updated_at: String,
35    /// The new access token for this virtual key. This is only returned when the key is created or rotated, and cannot be retrieved again afterward.
36    #[serde(rename = "access_token")]
37    pub access_token: String,
38}
39
40impl ArcRotateVirtualKeyResponse {
41    /// The virtual key that was rotated, including its new access token.
42    pub fn new(id: String, customer_id: String, name: String, user_id: String, created_at: String, updated_at: String, access_token: String) -> ArcRotateVirtualKeyResponse {
43        ArcRotateVirtualKeyResponse {
44            id,
45            customer_id,
46            name,
47            user_id,
48            expires_at: None,
49            created_at,
50            updated_at,
51            access_token,
52        }
53    }
54}
55
56