Skip to main content

fastly_api/models/
operation_get.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 OperationGet {
13    /// The HTTP method for the operation.
14    #[serde(rename = "method")]
15    pub method: Method,
16    /// The domain for the operation.
17    #[serde(rename = "domain")]
18    pub domain: String,
19    /// The path for the operation, which may include path parameters.
20    #[serde(rename = "path")]
21    pub path: String,
22    /// A description of what the operation does.
23    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
24    pub description: Option<String>,
25    /// An array of operation tag IDs associated with this operation.
26    #[serde(rename = "tag_ids", skip_serializing_if = "Option::is_none")]
27    pub tag_ids: Option<Vec<String>>,
28    /// The unique identifier of the operation.
29    #[serde(rename = "id")]
30    pub id: String,
31    /// The timestamp when the operation was created.
32    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
33    pub created_at: Option<String>,
34    /// The timestamp when the operation was last updated.
35    #[serde(rename = "updated_at")]
36    pub updated_at: String,
37    /// The timestamp when the operation was last seen in traffic.
38    #[serde(rename = "last_seen_at", skip_serializing_if = "Option::is_none")]
39    pub last_seen_at: Option<String>,
40    /// Requests per second observed for this operation.
41    #[serde(rename = "rps", skip_serializing_if = "Option::is_none")]
42    pub rps: Option<f32>,
43    /// The status of the operation.
44    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
45    pub status: Option<Status>,
46}
47
48impl OperationGet {
49    pub fn new(method: Method, domain: String, path: String, id: String, updated_at: String) -> OperationGet {
50        OperationGet {
51            method,
52            domain,
53            path,
54            description: None,
55            tag_ids: None,
56            id,
57            created_at: None,
58            updated_at,
59            last_seen_at: None,
60            rps: None,
61            status: None,
62        }
63    }
64}
65
66/// The HTTP method for the operation.
67#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
68pub enum Method {
69    #[serde(rename = "GET")]
70    GET,
71    #[serde(rename = "POST")]
72    POST,
73    #[serde(rename = "PUT")]
74    PUT,
75    #[serde(rename = "PATCH")]
76    PATCH,
77    #[serde(rename = "DELETE")]
78    DELETE,
79    #[serde(rename = "HEAD")]
80    HEAD,
81    #[serde(rename = "OPTIONS")]
82    OPTIONS,
83    #[serde(rename = "CONNECT")]
84    CONNECT,
85    #[serde(rename = "TRACE")]
86    TRACE,
87}
88
89impl Default for Method {
90    fn default() -> Method {
91        Self::GET
92    }
93}
94/// The status of the operation.
95#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
96pub enum Status {
97    #[serde(rename = "SAVED")]
98    SAVED,
99    #[serde(rename = "IGNORED")]
100    IGNORED,
101}
102
103impl Default for Status {
104    fn default() -> Status {
105        Self::SAVED
106    }
107}
108