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}
41
42impl OperationGet {
43    pub fn new(method: Method, domain: String, path: String, id: String, updated_at: String) -> OperationGet {
44        OperationGet {
45            method,
46            domain,
47            path,
48            description: None,
49            tag_ids: None,
50            id,
51            created_at: None,
52            updated_at,
53            last_seen_at: None,
54        }
55    }
56}
57
58/// The HTTP method for the operation.
59#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
60pub enum Method {
61    #[serde(rename = "GET")]
62    GET,
63    #[serde(rename = "POST")]
64    POST,
65    #[serde(rename = "PUT")]
66    PUT,
67    #[serde(rename = "PATCH")]
68    PATCH,
69    #[serde(rename = "DELETE")]
70    DELETE,
71    #[serde(rename = "HEAD")]
72    HEAD,
73    #[serde(rename = "OPTIONS")]
74    OPTIONS,
75    #[serde(rename = "CONNECT")]
76    CONNECT,
77    #[serde(rename = "TRACE")]
78    TRACE,
79}
80
81impl Default for Method {
82    fn default() -> Method {
83        Self::GET
84    }
85}
86