fastly_api/models/
automation_token_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
9
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct AutomationTokenResponse {
13    /// The name of the token.
14    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
15    pub name: Option<String>,
16    #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
17    pub role: Option<String>,
18    /// (Optional) The service IDs of the services the token will have access to. Separate service IDs with a space. If no services are specified, the token will have access to all services on the account. 
19    #[serde(rename = "services", skip_serializing_if = "Option::is_none")]
20    pub services: Option<Vec<String>>,
21    /// A space-delimited list of authorization scope.
22    #[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
23    pub scope: Option<Scope>,
24    /// (optional) A UTC timestamp of when the token will expire.
25    #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
26    pub expires_at: Option<String>,
27    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
28    pub id: Option<Box<crate::models::ReadOnlyId>>,
29    #[serde(rename = "customer_id", skip_serializing_if = "Option::is_none")]
30    pub customer_id: Option<Box<crate::models::ReadOnlyCustomerId>>,
31    /// The IP address of the client that last used the token.
32    #[serde(rename = "ip", skip_serializing_if = "Option::is_none")]
33    pub ip: Option<String>,
34    /// The User-Agent header of the client that last used the token.
35    #[serde(rename = "user_agent", skip_serializing_if = "Option::is_none")]
36    pub user_agent: Option<String>,
37    /// Indicates whether TLS access is enabled for the token.
38    #[serde(rename = "tls_access", skip_serializing_if = "Option::is_none")]
39    pub tls_access: Option<bool>,
40    /// A UTC timestamp of when the token was last used.
41    #[serde(rename = "last_used_at", skip_serializing_if = "Option::is_none")]
42    pub last_used_at: Option<String>,
43    /// A UTC timestamp of when the token was created.
44    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
45    pub created_at: Option<String>,
46}
47
48impl AutomationTokenResponse {
49    pub fn new() -> AutomationTokenResponse {
50        AutomationTokenResponse {
51            name: None,
52            role: None,
53            services: None,
54            scope: None,
55            expires_at: None,
56            id: None,
57            customer_id: None,
58            ip: None,
59            user_agent: None,
60            tls_access: None,
61            last_used_at: None,
62            created_at: None,
63        }
64    }
65}
66
67/// A space-delimited list of authorization scope.
68#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
69pub enum Scope {
70    #[serde(rename = "global")]
71    Global,
72    #[serde(rename = "purge_select")]
73    PurgeSelect,
74    #[serde(rename = "purge_all")]
75    PurgeAll,
76    #[serde(rename = "global:read")]
77    Globalread,
78}
79
80impl Default for Scope {
81    fn default() -> Scope {
82        Self::Global
83    }
84}
85