#[non_exhaustive]pub struct IpRules {
pub direction: Direction,
pub source_ip_ranges: Vec<String>,
pub destination_ip_ranges: Vec<String>,
pub exposed_services: Vec<String>,
pub rules: Option<Rules>,
/* private fields */
}Expand description
IP rules associated with the finding.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.direction: DirectionThe direction that the rule is applicable to, one of ingress or egress.
source_ip_ranges: Vec<String>If source IP ranges are specified, the firewall rule applies only to traffic that has a source IP address in these ranges. These ranges must be expressed in CIDR format. Only supports IPv4.
destination_ip_ranges: Vec<String>If destination IP ranges are specified, the firewall rule applies only to traffic that has a destination IP address in these ranges. These ranges must be expressed in CIDR format. Only supports IPv4.
exposed_services: Vec<String>Name of the network protocol service, such as FTP, that is exposed by the open port. Follows the naming convention available at: https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml.
rules: Option<Rules>The list of allow rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection.
Implementations§
Source§impl IpRules
impl IpRules
pub fn new() -> Self
Sourcepub fn set_direction<T: Into<Direction>>(self, v: T) -> Self
pub fn set_direction<T: Into<Direction>>(self, v: T) -> Self
Sourcepub fn set_source_ip_ranges<T, V>(self, v: T) -> Self
pub fn set_source_ip_ranges<T, V>(self, v: T) -> Self
Sets the value of source_ip_ranges.
§Example
let x = IpRules::new().set_source_ip_ranges(["a", "b", "c"]);Sourcepub fn set_destination_ip_ranges<T, V>(self, v: T) -> Self
pub fn set_destination_ip_ranges<T, V>(self, v: T) -> Self
Sets the value of destination_ip_ranges.
§Example
let x = IpRules::new().set_destination_ip_ranges(["a", "b", "c"]);Sourcepub fn set_exposed_services<T, V>(self, v: T) -> Self
pub fn set_exposed_services<T, V>(self, v: T) -> Self
Sets the value of exposed_services.
§Example
let x = IpRules::new().set_exposed_services(["a", "b", "c"]);Sourcepub fn allowed(&self) -> Option<&Box<Allowed>>
pub fn allowed(&self) -> Option<&Box<Allowed>>
The value of rules
if it holds a Allowed, None if the field is not set or
holds a different branch.
Sourcepub fn set_allowed<T: Into<Box<Allowed>>>(self, v: T) -> Self
pub fn set_allowed<T: Into<Box<Allowed>>>(self, v: T) -> Self
Sets the value of rules
to hold a Allowed.
Note that all the setters affecting rules are
mutually exclusive.
§Example
use google_cloud_securitycenter_v2::model::Allowed;
let x = IpRules::new().set_allowed(Allowed::default()/* use setters */);
assert!(x.allowed().is_some());
assert!(x.denied().is_none());Sourcepub fn denied(&self) -> Option<&Box<Denied>>
pub fn denied(&self) -> Option<&Box<Denied>>
The value of rules
if it holds a Denied, None if the field is not set or
holds a different branch.
Sourcepub fn set_denied<T: Into<Box<Denied>>>(self, v: T) -> Self
pub fn set_denied<T: Into<Box<Denied>>>(self, v: T) -> Self
Sets the value of rules
to hold a Denied.
Note that all the setters affecting rules are
mutually exclusive.
§Example
use google_cloud_securitycenter_v2::model::Denied;
let x = IpRules::new().set_denied(Denied::default()/* use setters */);
assert!(x.denied().is_some());
assert!(x.allowed().is_none());