#[non_exhaustive]pub struct NetworkPolicy {
pub name: String,
pub create_time: Option<Timestamp>,
pub update_time: Option<Timestamp>,
pub internet_access: Option<NetworkService>,
pub external_ip: Option<NetworkService>,
pub edge_services_cidr: String,
pub uid: String,
pub vmware_engine_network: String,
pub description: String,
pub vmware_engine_network_canonical: String,
/* private fields */
}Expand description
Represents a network policy resource. Network policies are regional resources. You can use a network policy to enable or disable internet access and external IP access. Network policies are associated with a VMware Engine network, which might span across regions. For a given region, a network policy applies to all private clouds in the VMware Engine network associated with the policy.
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.name: StringOutput only. The resource name of this network policy.
Resource names are schemeless URIs that follow the conventions in
https://cloud.google.com/apis/design/resource_names.
For example:
projects/my-project/locations/us-central1/networkPolicies/my-network-policy
create_time: Option<Timestamp>Output only. Creation time of this resource.
update_time: Option<Timestamp>Output only. Last update time of this resource.
internet_access: Option<NetworkService>Network service that allows VMware workloads to access the internet.
external_ip: Option<NetworkService>Network service that allows External IP addresses to be assigned to VMware
workloads. This service can only be enabled when internet_access is also
enabled.
edge_services_cidr: StringRequired. IP address range in CIDR notation used to create internet access and external IP access. An RFC 1918 CIDR block, with a “/26” prefix, is required. The range cannot overlap with any prefixes either in the consumer VPC network or in use by the private clouds attached to that VPC network.
uid: StringOutput only. System-generated unique identifier for the resource.
vmware_engine_network: StringOptional. The relative resource name of the VMware Engine network.
Specify the name in the following form:
projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}
where {project} can either be a project number or a project ID.
description: StringOptional. User-provided description for this network policy.
vmware_engine_network_canonical: StringOutput only. The canonical name of the VMware Engine network in the form:
projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}
Implementations§
Source§impl NetworkPolicy
impl NetworkPolicy
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = NetworkPolicy::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = NetworkPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = NetworkPolicy::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_update_time<T>(self, v: T) -> Self
pub fn set_update_time<T>(self, v: T) -> Self
Sets the value of update_time.
§Example
use wkt::Timestamp;
let x = NetworkPolicy::new().set_update_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_time.
§Example
use wkt::Timestamp;
let x = NetworkPolicy::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = NetworkPolicy::new().set_or_clear_update_time(None::<Timestamp>);Sourcepub fn set_internet_access<T>(self, v: T) -> Selfwhere
T: Into<NetworkService>,
pub fn set_internet_access<T>(self, v: T) -> Selfwhere
T: Into<NetworkService>,
Sets the value of internet_access.
§Example
use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
let x = NetworkPolicy::new().set_internet_access(NetworkService::default()/* use setters */);Sourcepub fn set_or_clear_internet_access<T>(self, v: Option<T>) -> Selfwhere
T: Into<NetworkService>,
pub fn set_or_clear_internet_access<T>(self, v: Option<T>) -> Selfwhere
T: Into<NetworkService>,
Sets or clears the value of internet_access.
§Example
use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
let x = NetworkPolicy::new().set_or_clear_internet_access(Some(NetworkService::default()/* use setters */));
let x = NetworkPolicy::new().set_or_clear_internet_access(None::<NetworkService>);Sourcepub fn set_external_ip<T>(self, v: T) -> Selfwhere
T: Into<NetworkService>,
pub fn set_external_ip<T>(self, v: T) -> Selfwhere
T: Into<NetworkService>,
Sets the value of external_ip.
§Example
use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
let x = NetworkPolicy::new().set_external_ip(NetworkService::default()/* use setters */);Sourcepub fn set_or_clear_external_ip<T>(self, v: Option<T>) -> Selfwhere
T: Into<NetworkService>,
pub fn set_or_clear_external_ip<T>(self, v: Option<T>) -> Selfwhere
T: Into<NetworkService>,
Sets or clears the value of external_ip.
§Example
use google_cloud_vmwareengine_v1::model::network_policy::NetworkService;
let x = NetworkPolicy::new().set_or_clear_external_ip(Some(NetworkService::default()/* use setters */));
let x = NetworkPolicy::new().set_or_clear_external_ip(None::<NetworkService>);Sourcepub fn set_edge_services_cidr<T: Into<String>>(self, v: T) -> Self
pub fn set_edge_services_cidr<T: Into<String>>(self, v: T) -> Self
Sets the value of edge_services_cidr.
§Example
let x = NetworkPolicy::new().set_edge_services_cidr("example");Sourcepub fn set_vmware_engine_network<T: Into<String>>(self, v: T) -> Self
pub fn set_vmware_engine_network<T: Into<String>>(self, v: T) -> Self
Sets the value of vmware_engine_network.
§Example
let x = NetworkPolicy::new().set_vmware_engine_network(format!("projects/{project_id}/locations/{location_id}/vmwareEngineNetworks/{vmware_engine_network_id}"));Sourcepub fn set_description<T: Into<String>>(self, v: T) -> Self
pub fn set_description<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_vmware_engine_network_canonical<T: Into<String>>(self, v: T) -> Self
pub fn set_vmware_engine_network_canonical<T: Into<String>>(self, v: T) -> Self
Sets the value of vmware_engine_network_canonical.
§Example
let x = NetworkPolicy::new().set_vmware_engine_network_canonical(format!("projects/{project_id}/locations/{location_id}/vmwareEngineNetworks/{vmware_engine_network_id}"));Trait Implementations§
Source§impl Clone for NetworkPolicy
impl Clone for NetworkPolicy
Source§fn clone(&self) -> NetworkPolicy
fn clone(&self) -> NetworkPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NetworkPolicy
impl Debug for NetworkPolicy
Source§impl Default for NetworkPolicy
impl Default for NetworkPolicy
Source§fn default() -> NetworkPolicy
fn default() -> NetworkPolicy
Source§impl Message for NetworkPolicy
impl Message for NetworkPolicy
Source§impl PartialEq for NetworkPolicy
impl PartialEq for NetworkPolicy
impl StructuralPartialEq for NetworkPolicy
Auto Trait Implementations§
impl Freeze for NetworkPolicy
impl RefUnwindSafe for NetworkPolicy
impl Send for NetworkPolicy
impl Sync for NetworkPolicy
impl Unpin for NetworkPolicy
impl UnsafeUnpin for NetworkPolicy
impl UnwindSafe for NetworkPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request