Skip to main content

fastly_api/models/
discovered_operation_base.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 DiscoveredOperationBase {
13    /// The HTTP method for the operation.
14    #[serde(rename = "method", skip_serializing_if = "Option::is_none")]
15    pub method: Option<Method>,
16    /// The domain for the operation.
17    #[serde(rename = "domain", skip_serializing_if = "Option::is_none")]
18    pub domain: Option<String>,
19    /// The path for the operation, which may include path parameters.
20    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
21    pub path: Option<String>,
22}
23
24impl DiscoveredOperationBase {
25    pub fn new() -> DiscoveredOperationBase {
26        DiscoveredOperationBase {
27            method: None,
28            domain: None,
29            path: None,
30        }
31    }
32}
33
34/// The HTTP method for the operation.
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum Method {
37    #[serde(rename = "GET")]
38    GET,
39    #[serde(rename = "POST")]
40    POST,
41    #[serde(rename = "PUT")]
42    PUT,
43    #[serde(rename = "PATCH")]
44    PATCH,
45    #[serde(rename = "DELETE")]
46    DELETE,
47    #[serde(rename = "HEAD")]
48    HEAD,
49    #[serde(rename = "OPTIONS")]
50    OPTIONS,
51    #[serde(rename = "CONNECT")]
52    CONNECT,
53    #[serde(rename = "TRACE")]
54    TRACE,
55}
56
57impl Default for Method {
58    fn default() -> Method {
59        Self::GET
60    }
61}
62