fastly_api/models/
automation_token_create_request_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 AutomationTokenCreateRequestAttributes {
13    /// 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<Role>,
18    /// List of service ids to limit the token
19    #[serde(rename = "services", skip_serializing_if = "Option::is_none")]
20    pub services: Option<Vec<String>>,
21    #[serde(rename = "scope", skip_serializing_if = "Option::is_none")]
22    pub scope: Option<Scope>,
23    /// A UTC timestamp of when the token will expire.
24    #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
25    pub expires_at: Option<String>,
26    /// Indicates whether TLS access is enabled for the token.
27    #[serde(rename = "tls_access", skip_serializing_if = "Option::is_none")]
28    pub tls_access: Option<bool>,
29}
30
31impl AutomationTokenCreateRequestAttributes {
32    pub fn new() -> AutomationTokenCreateRequestAttributes {
33        AutomationTokenCreateRequestAttributes {
34            name: None,
35            role: None,
36            services: None,
37            scope: None,
38            expires_at: None,
39            tls_access: None,
40        }
41    }
42}
43
44/// 
45#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
46pub enum Role {
47    #[serde(rename = "engineer")]
48    Engineer,
49    #[serde(rename = "billing")]
50    Billing,
51    #[serde(rename = "user")]
52    User,
53}
54
55impl Default for Role {
56    fn default() -> Role {
57        Self::Engineer
58    }
59}
60/// 
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum Scope {
63    #[serde(rename = "global")]
64    Global,
65    #[serde(rename = "global:read")]
66    Globalread,
67    #[serde(rename = "purge_all")]
68    PurgeAll,
69    #[serde(rename = "purge_select")]
70    PurgeSelect,
71}
72
73impl Default for Scope {
74    fn default() -> Scope {
75        Self::Global
76    }
77}
78