Skip to main content

fastly_api/models/
discovered_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 DiscoveredOperationGet {
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    /// The current status of the operation.
23    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
24    pub status: Option<Status>,
25    /// The timestamp when the operation was last updated.
26    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
27    pub updated_at: Option<String>,
28    /// The timestamp when the operation was last seen in traffic.
29    #[serde(rename = "last_seen_at", skip_serializing_if = "Option::is_none")]
30    pub last_seen_at: Option<String>,
31}
32
33impl DiscoveredOperationGet {
34    pub fn new(method: Method, domain: String, path: String) -> DiscoveredOperationGet {
35        DiscoveredOperationGet {
36            method,
37            domain,
38            path,
39            status: None,
40            updated_at: None,
41            last_seen_at: None,
42        }
43    }
44}
45
46/// The HTTP method for the operation.
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum Method {
49    #[serde(rename = "GET")]
50    GET,
51    #[serde(rename = "POST")]
52    POST,
53    #[serde(rename = "PUT")]
54    PUT,
55    #[serde(rename = "PATCH")]
56    PATCH,
57    #[serde(rename = "DELETE")]
58    DELETE,
59    #[serde(rename = "HEAD")]
60    HEAD,
61    #[serde(rename = "OPTIONS")]
62    OPTIONS,
63    #[serde(rename = "CONNECT")]
64    CONNECT,
65    #[serde(rename = "TRACE")]
66    TRACE,
67}
68
69impl Default for Method {
70    fn default() -> Method {
71        Self::GET
72    }
73}
74/// The current status of the operation.
75#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
76pub enum Status {
77    #[serde(rename = "DISCOVERED")]
78    DISCOVERED,
79    #[serde(rename = "SAVED")]
80    SAVED,
81    #[serde(rename = "IGNORED")]
82    IGNORED,
83}
84
85impl Default for Status {
86    fn default() -> Status {
87        Self::DISCOVERED
88    }
89}
90