fastly_api/models/
acl_entry.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 AclEntry {
13    /// Whether to negate the match. Useful primarily when creating individual exceptions to larger subnets.
14    #[serde(rename = "negated", skip_serializing_if = "Option::is_none")]
15    pub negated: Option<Negated>,
16    /// A freeform descriptive note.
17    #[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
18    pub comment: Option<String>,
19    /// An IP address.
20    #[serde(rename = "ip", skip_serializing_if = "Option::is_none")]
21    pub ip: Option<String>,
22    /// Number of bits for the subnet mask applied to the IP address. For IPv4 addresses, a value of 32 represents the smallest subnet mask (1 address), 24 represents a class C subnet mask (256 addresses), 16 represents a class B subnet mask (65k addresses), and 8 is class A subnet mask (16m addresses). If not provided, no mask is applied.
23    #[serde(rename = "subnet", skip_serializing_if = "Option::is_none")]
24    pub subnet: Option<i32>,
25}
26
27impl AclEntry {
28    pub fn new() -> AclEntry {
29        AclEntry {
30            negated: None,
31            comment: None,
32            ip: None,
33            subnet: None,
34        }
35    }
36}
37
38/// Whether to negate the match. Useful primarily when creating individual exceptions to larger subnets.
39#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
40pub enum Negated {
41    #[serde(rename = "0")]
42    NegatedDisable,
43    #[serde(rename = "1")]
44    NegatedEnable,
45}
46
47impl Default for Negated {
48    fn default() -> Negated {
49        Self::NegatedDisable
50    }
51}
52