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 unique identifier of the discovered operation.
23    #[serde(rename = "id")]
24    pub id: String,
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    /// Requests per second observed for this operation.
32    #[serde(rename = "rps", skip_serializing_if = "Option::is_none")]
33    pub rps: Option<f32>,
34}
35
36impl DiscoveredOperationGet {
37    pub fn new(method: Method, domain: String, path: String, id: String) -> DiscoveredOperationGet {
38        DiscoveredOperationGet {
39            method,
40            domain,
41            path,
42            id,
43            updated_at: None,
44            last_seen_at: None,
45            rps: None,
46        }
47    }
48}
49
50/// The HTTP method for the operation.
51#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
52pub enum Method {
53    #[serde(rename = "GET")]
54    GET,
55    #[serde(rename = "POST")]
56    POST,
57    #[serde(rename = "PUT")]
58    PUT,
59    #[serde(rename = "PATCH")]
60    PATCH,
61    #[serde(rename = "DELETE")]
62    DELETE,
63    #[serde(rename = "HEAD")]
64    HEAD,
65    #[serde(rename = "OPTIONS")]
66    OPTIONS,
67    #[serde(rename = "CONNECT")]
68    CONNECT,
69    #[serde(rename = "TRACE")]
70    TRACE,
71}
72
73impl Default for Method {
74    fn default() -> Method {
75        Self::GET
76    }
77}
78