fastly_api/models/
apex_redirect.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 ApexRedirect {
13    #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")]
14    pub service_id: Option<Box<String>>,
15    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
16    pub version: Option<Box<i32>>,
17    /// Date and time in ISO 8601 format.
18    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
19    pub created_at: Option<String>,
20    /// Date and time in ISO 8601 format.
21    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
22    pub deleted_at: Option<String>,
23    /// Date and time in ISO 8601 format.
24    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
25    pub updated_at: Option<String>,
26    /// HTTP status code used to redirect the client.
27    #[serde(rename = "status_code", skip_serializing_if = "Option::is_none")]
28    pub status_code: Option<StatusCode>,
29    /// Array of apex domains that should redirect to their WWW subdomain.
30    #[serde(rename = "domains", skip_serializing_if = "Option::is_none")]
31    pub domains: Option<Vec<String>>,
32    /// Revision number of the apex redirect feature implementation. Defaults to the most recent revision.
33    #[serde(rename = "feature_revision", skip_serializing_if = "Option::is_none")]
34    pub feature_revision: Option<i32>,
35}
36
37impl ApexRedirect {
38    pub fn new() -> ApexRedirect {
39        ApexRedirect {
40            service_id: None,
41            version: None,
42            created_at: None,
43            deleted_at: None,
44            updated_at: None,
45            status_code: None,
46            domains: None,
47            feature_revision: None,
48        }
49    }
50}
51
52/// HTTP status code used to redirect the client.
53#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
54pub enum StatusCode {
55    #[serde(rename = "301")]
56    StatusCode301,
57    #[serde(rename = "302")]
58    StatusCode302,
59    #[serde(rename = "307")]
60    StatusCode307,
61    #[serde(rename = "308")]
62    StatusCode308,
63}
64
65impl Default for StatusCode {
66    fn default() -> StatusCode {
67        Self::StatusCode301
68    }
69}
70