#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_iam_v1;
extern crate google_cloud_location;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate google_cloud_rpc;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
pub create_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub target: std::string::String,
pub verb: std::string::String,
pub status_message: std::string::String,
pub requested_cancellation: bool,
pub api_version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OperationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = v.into();
self
}
pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.verb = v.into();
self
}
pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.status_message = v.into();
self
}
pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.requested_cancellation = v.into();
self
}
pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.api_version = v.into();
self
}
}
impl wkt::message::Message for OperationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceConnectionMap {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub service_class: std::string::String,
pub service_class_uri: std::string::String,
pub infrastructure: crate::model::Infrastructure,
pub producer_psc_configs:
std::vec::Vec<crate::model::service_connection_map::ProducerPscConfig>,
pub consumer_psc_configs:
std::vec::Vec<crate::model::service_connection_map::ConsumerPscConfig>,
pub consumer_psc_connections:
std::vec::Vec<crate::model::service_connection_map::ConsumerPscConnection>,
pub token: std::string::String,
pub etag: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceConnectionMap {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_class = v.into();
self
}
pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_class_uri = v.into();
self
}
pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
mut self,
v: T,
) -> Self {
self.infrastructure = v.into();
self
}
pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
{
use std::iter::Iterator;
self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
{
use std::iter::Iterator;
self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
{
use std::iter::Iterator;
self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.token = v.into();
self
}
pub fn set_etag<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ServiceConnectionMap {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
}
}
pub mod service_connection_map {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ProducerPscConfig {
pub service_attachment_uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ProducerPscConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_attachment_uri = v.into();
self
}
}
impl wkt::message::Message for ProducerPscConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConsumerPscConfig {
pub project: std::string::String,
pub network: std::string::String,
pub disable_global_access: bool,
pub state: crate::model::service_connection_map::consumer_psc_config::State,
#[deprecated]
pub producer_instance_id: std::string::String,
pub service_attachment_ip_address_map:
std::collections::HashMap<std::string::String, std::string::String>,
pub consumer_instance_project: std::string::String,
pub producer_instance_metadata:
std::collections::HashMap<std::string::String, std::string::String>,
pub ip_version: std::option::Option<crate::model::IPVersion>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConsumerPscConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disable_global_access = v.into();
self
}
pub fn set_state<
T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
#[deprecated]
pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.producer_instance_id = v.into();
self
}
pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.service_attachment_ip_address_map =
v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.consumer_instance_project = v.into();
self
}
pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.producer_instance_metadata =
v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_ip_version<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::IPVersion>,
{
self.ip_version = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::IPVersion>,
{
self.ip_version = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ConsumerPscConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
}
}
pub mod consumer_psc_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Valid,
ConnectionPolicyMissing,
PolicyLimitReached,
ConsumerInstanceProjectNotAllowlisted,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Valid => std::option::Option::Some(1),
Self::ConnectionPolicyMissing => std::option::Option::Some(2),
Self::PolicyLimitReached => std::option::Option::Some(3),
Self::ConsumerInstanceProjectNotAllowlisted => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Valid => std::option::Option::Some("VALID"),
Self::ConnectionPolicyMissing => {
std::option::Option::Some("CONNECTION_POLICY_MISSING")
}
Self::PolicyLimitReached => std::option::Option::Some("POLICY_LIMIT_REACHED"),
Self::ConsumerInstanceProjectNotAllowlisted => {
std::option::Option::Some("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Valid,
2 => Self::ConnectionPolicyMissing,
3 => Self::PolicyLimitReached,
4 => Self::ConsumerInstanceProjectNotAllowlisted,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"VALID" => Self::Valid,
"CONNECTION_POLICY_MISSING" => Self::ConnectionPolicyMissing,
"POLICY_LIMIT_REACHED" => Self::PolicyLimitReached,
"CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
Self::ConsumerInstanceProjectNotAllowlisted
}
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Valid => serializer.serialize_i32(1),
Self::ConnectionPolicyMissing => serializer.serialize_i32(2),
Self::PolicyLimitReached => serializer.serialize_i32(3),
Self::ConsumerInstanceProjectNotAllowlisted => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig.State"))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ConsumerPscConnection {
pub service_attachment_uri: std::string::String,
pub state: crate::model::service_connection_map::consumer_psc_connection::State,
pub project: std::string::String,
pub network: std::string::String,
pub psc_connection_id: std::string::String,
pub ip: std::string::String,
#[deprecated]
pub error_type: crate::model::ConnectionErrorType,
#[deprecated]
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub gce_operation: std::string::String,
pub forwarding_rule: std::string::String,
pub error_info: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
pub selected_subnetwork: std::string::String,
#[deprecated]
pub producer_instance_id: std::string::String,
pub producer_instance_metadata:
std::collections::HashMap<std::string::String, std::string::String>,
pub ip_version: std::option::Option<crate::model::IPVersion>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ConsumerPscConnection {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_attachment_uri = v.into();
self
}
pub fn set_state<
T: std::convert::Into<
crate::model::service_connection_map::consumer_psc_connection::State,
>,
>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project = v.into();
self
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.psc_connection_id = v.into();
self
}
pub fn set_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ip = v.into();
self
}
#[deprecated]
pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
mut self,
v: T,
) -> Self {
self.error_type = v.into();
self
}
#[deprecated]
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = std::option::Option::Some(v.into());
self
}
#[deprecated]
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.gce_operation = v.into();
self
}
pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.forwarding_rule = v.into();
self
}
pub fn set_error_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
{
self.error_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
{
self.error_info = v.map(|x| x.into());
self
}
pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.selected_subnetwork = v.into();
self
}
#[deprecated]
pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.producer_instance_id = v.into();
self
}
pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.producer_instance_metadata =
v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_ip_version<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::IPVersion>,
{
self.ip_version = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::IPVersion>,
{
self.ip_version = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ConsumerPscConnection {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
}
}
pub mod consumer_psc_connection {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
Failed,
Creating,
Deleting,
CreateRepairing,
DeleteRepairing,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Active => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::Creating => std::option::Option::Some(3),
Self::Deleting => std::option::Option::Some(4),
Self::CreateRepairing => std::option::Option::Some(5),
Self::DeleteRepairing => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Active,
2 => Self::Failed,
3 => Self::Creating,
4 => Self::Deleting,
5 => Self::CreateRepairing,
6 => Self::DeleteRepairing,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ACTIVE" => Self::Active,
"FAILED" => Self::Failed,
"CREATING" => Self::Creating,
"DELETING" => Self::Deleting,
"CREATE_REPAIRING" => Self::CreateRepairing,
"DELETE_REPAIRING" => Self::DeleteRepairing,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Active => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::Creating => serializer.serialize_i32(3),
Self::Deleting => serializer.serialize_i32(4),
Self::CreateRepairing => serializer.serialize_i32(5),
Self::DeleteRepairing => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State"))
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceConnectionMapsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListServiceConnectionMapsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListServiceConnectionMapsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceConnectionMapsResponse {
pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListServiceConnectionMapsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ServiceConnectionMap>,
{
use std::iter::Iterator;
self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListServiceConnectionMapsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
type PageItem = crate::model::ServiceConnectionMap;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.service_connection_maps
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetServiceConnectionMapRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetServiceConnectionMapRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetServiceConnectionMapRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateServiceConnectionMapRequest {
pub parent: std::string::String,
pub service_connection_map_id: std::string::String,
pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateServiceConnectionMapRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_connection_map_id = v.into();
self
}
pub fn set_service_connection_map<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceConnectionMap>,
{
self.service_connection_map = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceConnectionMap>,
{
self.service_connection_map = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateServiceConnectionMapRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateServiceConnectionMapRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateServiceConnectionMapRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_service_connection_map<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceConnectionMap>,
{
self.service_connection_map = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceConnectionMap>,
{
self.service_connection_map = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateServiceConnectionMapRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceConnectionMapRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub etag: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteServiceConnectionMapRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_etag<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DeleteServiceConnectionMapRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceConnectionPolicy {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub network: std::string::String,
pub service_class: std::string::String,
pub infrastructure: crate::model::Infrastructure,
pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,
pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,
pub etag: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceConnectionPolicy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_class = v.into();
self
}
pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
mut self,
v: T,
) -> Self {
self.infrastructure = v.into();
self
}
pub fn set_psc_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
{
self.psc_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
{
self.psc_config = v.map(|x| x.into());
self
}
pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
{
use std::iter::Iterator;
self.psc_connections = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_etag<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ServiceConnectionPolicy {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
}
}
pub mod service_connection_policy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PscConfig {
pub subnetworks: std::vec::Vec<std::string::String>,
pub limit: std::option::Option<i64>,
pub producer_instance_location:
crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PscConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.subnetworks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_limit<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i64>,
{
self.limit = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_limit<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i64>,
{
self.limit = v.map(|x| x.into());
self
}
pub fn set_producer_instance_location<
T: std::convert::Into<
crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
>,
>(
mut self,
v: T,
) -> Self {
self.producer_instance_location = v.into();
self
}
pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.allowed_google_producers_resource_hierarchy_level =
v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for PscConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
}
}
pub mod psc_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ProducerInstanceLocation {
Unspecified,
CustomResourceHierarchyLevels,
UnknownValue(producer_instance_location::UnknownValue),
}
#[doc(hidden)]
pub mod producer_instance_location {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ProducerInstanceLocation {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CustomResourceHierarchyLevels => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED")
}
Self::CustomResourceHierarchyLevels => {
std::option::Option::Some("CUSTOM_RESOURCE_HIERARCHY_LEVELS")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ProducerInstanceLocation {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ProducerInstanceLocation {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ProducerInstanceLocation {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CustomResourceHierarchyLevels,
_ => Self::UnknownValue(producer_instance_location::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ProducerInstanceLocation {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => Self::Unspecified,
"CUSTOM_RESOURCE_HIERARCHY_LEVELS" => Self::CustomResourceHierarchyLevels,
_ => Self::UnknownValue(producer_instance_location::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ProducerInstanceLocation {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::CustomResourceHierarchyLevels => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ProducerInstanceLocation {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProducerInstanceLocation>::new(
".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig.ProducerInstanceLocation"))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PscConnection {
pub state: crate::model::service_connection_policy::State,
pub consumer_forwarding_rule: std::string::String,
pub consumer_address: std::string::String,
#[deprecated]
pub error_type: crate::model::ConnectionErrorType,
#[deprecated]
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub gce_operation: std::string::String,
pub consumer_target_project: std::string::String,
pub psc_connection_id: std::string::String,
pub error_info: std::option::Option<google_cloud_rpc::model::ErrorInfo>,
pub selected_subnetwork: std::string::String,
#[deprecated]
pub producer_instance_id: std::string::String,
pub producer_instance_metadata:
std::collections::HashMap<std::string::String, std::string::String>,
pub service_class: std::string::String,
pub ip_version: std::option::Option<crate::model::IPVersion>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PscConnection {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.consumer_forwarding_rule = v.into();
self
}
pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.consumer_address = v.into();
self
}
#[deprecated]
pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
mut self,
v: T,
) -> Self {
self.error_type = v.into();
self
}
#[deprecated]
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = std::option::Option::Some(v.into());
self
}
#[deprecated]
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.gce_operation = v.into();
self
}
pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.consumer_target_project = v.into();
self
}
pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.psc_connection_id = v.into();
self
}
pub fn set_error_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
{
self.error_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::ErrorInfo>,
{
self.error_info = v.map(|x| x.into());
self
}
pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.selected_subnetwork = v.into();
self
}
#[deprecated]
pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.producer_instance_id = v.into();
self
}
pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.producer_instance_metadata =
v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_service_class<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_class = v.into();
self
}
pub fn set_ip_version<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::IPVersion>,
{
self.ip_version = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::IPVersion>,
{
self.ip_version = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PscConnection {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
Failed,
Creating,
Deleting,
CreateRepairing,
DeleteRepairing,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Active => std::option::Option::Some(1),
Self::Failed => std::option::Option::Some(2),
Self::Creating => std::option::Option::Some(3),
Self::Deleting => std::option::Option::Some(4),
Self::CreateRepairing => std::option::Option::Some(5),
Self::DeleteRepairing => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Active,
2 => Self::Failed,
3 => Self::Creating,
4 => Self::Deleting,
5 => Self::CreateRepairing,
6 => Self::DeleteRepairing,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ACTIVE" => Self::Active,
"FAILED" => Self::Failed,
"CREATING" => Self::Creating,
"DELETING" => Self::Deleting,
"CREATE_REPAIRING" => Self::CreateRepairing,
"DELETE_REPAIRING" => Self::DeleteRepairing,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Active => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::Creating => serializer.serialize_i32(3),
Self::Deleting => serializer.serialize_i32(4),
Self::CreateRepairing => serializer.serialize_i32(5),
Self::DeleteRepairing => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceConnectionPoliciesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListServiceConnectionPoliciesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceConnectionPoliciesResponse {
pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListServiceConnectionPoliciesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
{
use std::iter::Iterator;
self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListServiceConnectionPoliciesResponse
{
type PageItem = crate::model::ServiceConnectionPolicy;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.service_connection_policies
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetServiceConnectionPolicyRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetServiceConnectionPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetServiceConnectionPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateServiceConnectionPolicyRequest {
pub parent: std::string::String,
pub service_connection_policy_id: std::string::String,
pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateServiceConnectionPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_service_connection_policy_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_connection_policy_id = v.into();
self
}
pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
{
self.service_connection_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
{
self.service_connection_policy = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateServiceConnectionPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateServiceConnectionPolicyRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateServiceConnectionPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
{
self.service_connection_policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
{
self.service_connection_policy = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateServiceConnectionPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceConnectionPolicyRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub etag: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteServiceConnectionPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_etag<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DeleteServiceConnectionPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceClass {
pub name: std::string::String,
pub service_class: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub etag: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceClass {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service_class = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_etag<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ServiceClass {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceClass"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceClassesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListServiceClassesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListServiceClassesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceClassesResponse {
pub service_classes: std::vec::Vec<crate::model::ServiceClass>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListServiceClassesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_classes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ServiceClass>,
{
use std::iter::Iterator;
self.service_classes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListServiceClassesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListServiceClassesResponse {
type PageItem = crate::model::ServiceClass;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.service_classes
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetServiceClassRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetServiceClassRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetServiceClassRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceClassRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateServiceClassRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub service_class: std::option::Option<crate::model::ServiceClass>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateServiceClassRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_service_class<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceClass>,
{
self.service_class = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceClass>,
{
self.service_class = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateServiceClassRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceClassRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceClassRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub etag: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteServiceClassRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_etag<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DeleteServiceClassRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceClassRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceConnectionToken {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub network: std::string::String,
pub token: std::string::String,
pub expire_time: std::option::Option<wkt::Timestamp>,
pub etag: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceConnectionToken {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.token = v.into();
self
}
pub fn set_expire_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expire_time = v.map(|x| x.into());
self
}
pub fn set_etag<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ServiceConnectionToken {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionToken"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceConnectionTokensRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListServiceConnectionTokensRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListServiceConnectionTokensRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceConnectionTokensResponse {
pub service_connection_tokens: std::vec::Vec<crate::model::ServiceConnectionToken>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListServiceConnectionTokensResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_connection_tokens<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ServiceConnectionToken>,
{
use std::iter::Iterator;
self.service_connection_tokens = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListServiceConnectionTokensResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListServiceConnectionTokensResponse
{
type PageItem = crate::model::ServiceConnectionToken;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.service_connection_tokens
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetServiceConnectionTokenRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetServiceConnectionTokenRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetServiceConnectionTokenRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateServiceConnectionTokenRequest {
pub parent: std::string::String,
pub service_connection_token_id: std::string::String,
pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateServiceConnectionTokenRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_connection_token_id = v.into();
self
}
pub fn set_service_connection_token<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceConnectionToken>,
{
self.service_connection_token = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceConnectionToken>,
{
self.service_connection_token = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateServiceConnectionTokenRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceConnectionTokenRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub etag: std::option::Option<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteServiceConnectionTokenRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_etag<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.etag = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MulticloudDataTransferConfig {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub etag: std::string::String,
pub description: std::string::String,
pub destinations_count: i32,
pub destinations_active_count: i32,
pub services: std::collections::HashMap<std::string::String, crate::model::StateTimeline>,
pub uid: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MulticloudDataTransferConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_destinations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.destinations_count = v.into();
self
}
pub fn set_destinations_active_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.destinations_active_count = v.into();
self
}
pub fn set_services<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<crate::model::StateTimeline>,
{
use std::iter::Iterator;
self.services = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
}
impl wkt::message::Message for MulticloudDataTransferConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMulticloudDataTransferConfigsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub return_partial_success: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMulticloudDataTransferConfigsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.return_partial_success = v.into();
self
}
}
impl wkt::message::Message for ListMulticloudDataTransferConfigsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMulticloudDataTransferConfigsResponse {
pub multicloud_data_transfer_configs: std::vec::Vec<crate::model::MulticloudDataTransferConfig>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMulticloudDataTransferConfigsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_multicloud_data_transfer_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
{
use std::iter::Iterator;
self.multicloud_data_transfer_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListMulticloudDataTransferConfigsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListMulticloudDataTransferConfigsResponse
{
type PageItem = crate::model::MulticloudDataTransferConfig;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.multicloud_data_transfer_configs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetMulticloudDataTransferConfigRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetMulticloudDataTransferConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetMulticloudDataTransferConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMulticloudDataTransferConfigRequest {
pub parent: std::string::String,
pub multicloud_data_transfer_config_id: std::string::String,
pub multicloud_data_transfer_config:
std::option::Option<crate::model::MulticloudDataTransferConfig>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateMulticloudDataTransferConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_multicloud_data_transfer_config_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.multicloud_data_transfer_config_id = v.into();
self
}
pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
{
self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_multicloud_data_transfer_config<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
{
self.multicloud_data_transfer_config = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateMulticloudDataTransferConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.CreateMulticloudDataTransferConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateMulticloudDataTransferConfigRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub multicloud_data_transfer_config:
std::option::Option<crate::model::MulticloudDataTransferConfig>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateMulticloudDataTransferConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
{
self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_multicloud_data_transfer_config<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
{
self.multicloud_data_transfer_config = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateMulticloudDataTransferConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateMulticloudDataTransferConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteMulticloudDataTransferConfigRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteMulticloudDataTransferConfigRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteMulticloudDataTransferConfigRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteMulticloudDataTransferConfigRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Destination {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub etag: std::string::String,
pub description: std::string::String,
pub ip_prefix: std::string::String,
pub endpoints: std::vec::Vec<crate::model::destination::DestinationEndpoint>,
pub state_timeline: std::option::Option<crate::model::StateTimeline>,
pub uid: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Destination {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_ip_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ip_prefix = v.into();
self
}
pub fn set_endpoints<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::destination::DestinationEndpoint>,
{
use std::iter::Iterator;
self.endpoints = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_state_timeline<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::StateTimeline>,
{
self.state_timeline = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_state_timeline<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::StateTimeline>,
{
self.state_timeline = v.map(|x| x.into());
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
}
impl wkt::message::Message for Destination {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.Destination"
}
}
pub mod destination {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DestinationEndpoint {
pub asn: i64,
pub csp: std::string::String,
pub state: crate::model::destination::destination_endpoint::State,
pub update_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DestinationEndpoint {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_asn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.asn = v.into();
self
}
pub fn set_csp<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.csp = v.into();
self
}
pub fn set_state<
T: std::convert::Into<crate::model::destination::destination_endpoint::State>,
>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DestinationEndpoint {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint"
}
}
pub mod destination_endpoint {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Valid,
Invalid,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Valid => std::option::Option::Some(1),
Self::Invalid => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Valid => std::option::Option::Some("VALID"),
Self::Invalid => std::option::Option::Some("INVALID"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Valid,
2 => Self::Invalid,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"VALID" => Self::Valid,
"INVALID" => Self::Invalid,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Valid => serializer.serialize_i32(1),
Self::Invalid => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint.State",
))
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDestinationsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub return_partial_success: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDestinationsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.return_partial_success = v.into();
self
}
}
impl wkt::message::Message for ListDestinationsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDestinationsResponse {
pub destinations: std::vec::Vec<crate::model::Destination>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDestinationsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_destinations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Destination>,
{
use std::iter::Iterator;
self.destinations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListDestinationsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDestinationsResponse {
type PageItem = crate::model::Destination;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.destinations
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDestinationRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDestinationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetDestinationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetDestinationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDestinationRequest {
pub parent: std::string::String,
pub destination_id: std::string::String,
pub destination: std::option::Option<crate::model::Destination>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDestinationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_destination_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.destination_id = v.into();
self
}
pub fn set_destination<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Destination>,
{
self.destination = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Destination>,
{
self.destination = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateDestinationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.CreateDestinationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDestinationRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub destination: std::option::Option<crate::model::Destination>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDestinationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_destination<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Destination>,
{
self.destination = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Destination>,
{
self.destination = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateDestinationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateDestinationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDestinationRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDestinationRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteDestinationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteDestinationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StateTimeline {
pub states: std::vec::Vec<crate::model::state_timeline::StateMetadata>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StateTimeline {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_states<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::state_timeline::StateMetadata>,
{
use std::iter::Iterator;
self.states = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for StateTimeline {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline"
}
}
pub mod state_timeline {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StateMetadata {
pub state: crate::model::state_timeline::state_metadata::State,
pub effective_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StateMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state<
T: std::convert::Into<crate::model::state_timeline::state_metadata::State>,
>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_effective_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.effective_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.effective_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for StateMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata"
}
}
pub mod state_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Adding,
Active,
Deleting,
Suspending,
Suspended,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Adding => std::option::Option::Some(1),
Self::Active => std::option::Option::Some(2),
Self::Deleting => std::option::Option::Some(3),
Self::Suspending => std::option::Option::Some(4),
Self::Suspended => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Adding => std::option::Option::Some("ADDING"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Suspending => std::option::Option::Some("SUSPENDING"),
Self::Suspended => std::option::Option::Some("SUSPENDED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Adding,
2 => Self::Active,
3 => Self::Deleting,
4 => Self::Suspending,
5 => Self::Suspended,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ADDING" => Self::Adding,
"ACTIVE" => Self::Active,
"DELETING" => Self::Deleting,
"SUSPENDING" => Self::Suspending,
"SUSPENDED" => Self::Suspended,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Adding => serializer.serialize_i32(1),
Self::Active => serializer.serialize_i32(2),
Self::Deleting => serializer.serialize_i32(3),
Self::Suspending => serializer.serialize_i32(4),
Self::Suspended => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata.State",
))
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MulticloudDataTransferSupportedService {
pub name: std::string::String,
pub service_configs: std::vec::Vec<crate::model::ServiceConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MulticloudDataTransferSupportedService {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_service_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ServiceConfig>,
{
use std::iter::Iterator;
self.service_configs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MulticloudDataTransferSupportedService {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferSupportedService"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceConfig {
pub eligibility_criteria: crate::model::service_config::EligibilityCriteria,
pub support_end_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_eligibility_criteria<
T: std::convert::Into<crate::model::service_config::EligibilityCriteria>,
>(
mut self,
v: T,
) -> Self {
self.eligibility_criteria = v.into();
self
}
pub fn set_support_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.support_end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.support_end_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ServiceConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConfig"
}
}
pub mod service_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum EligibilityCriteria {
Unspecified,
NetworkServiceTierPremiumOnly,
NetworkServiceTierStandardOnly,
RequestEndpointRegionalEndpointOnly,
UnknownValue(eligibility_criteria::UnknownValue),
}
#[doc(hidden)]
pub mod eligibility_criteria {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl EligibilityCriteria {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::NetworkServiceTierPremiumOnly => std::option::Option::Some(1),
Self::NetworkServiceTierStandardOnly => std::option::Option::Some(2),
Self::RequestEndpointRegionalEndpointOnly => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ELIGIBILITY_CRITERIA_UNSPECIFIED"),
Self::NetworkServiceTierPremiumOnly => {
std::option::Option::Some("NETWORK_SERVICE_TIER_PREMIUM_ONLY")
}
Self::NetworkServiceTierStandardOnly => {
std::option::Option::Some("NETWORK_SERVICE_TIER_STANDARD_ONLY")
}
Self::RequestEndpointRegionalEndpointOnly => {
std::option::Option::Some("REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for EligibilityCriteria {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for EligibilityCriteria {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for EligibilityCriteria {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::NetworkServiceTierPremiumOnly,
2 => Self::NetworkServiceTierStandardOnly,
3 => Self::RequestEndpointRegionalEndpointOnly,
_ => Self::UnknownValue(eligibility_criteria::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for EligibilityCriteria {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ELIGIBILITY_CRITERIA_UNSPECIFIED" => Self::Unspecified,
"NETWORK_SERVICE_TIER_PREMIUM_ONLY" => Self::NetworkServiceTierPremiumOnly,
"NETWORK_SERVICE_TIER_STANDARD_ONLY" => Self::NetworkServiceTierStandardOnly,
"REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY" => {
Self::RequestEndpointRegionalEndpointOnly
}
_ => Self::UnknownValue(eligibility_criteria::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for EligibilityCriteria {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::NetworkServiceTierPremiumOnly => serializer.serialize_i32(1),
Self::NetworkServiceTierStandardOnly => serializer.serialize_i32(2),
Self::RequestEndpointRegionalEndpointOnly => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for EligibilityCriteria {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<EligibilityCriteria>::new(
".google.cloud.networkconnectivity.v1.ServiceConfig.EligibilityCriteria",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetMulticloudDataTransferSupportedServiceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetMulticloudDataTransferSupportedServiceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetMulticloudDataTransferSupportedServiceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferSupportedServiceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMulticloudDataTransferSupportedServicesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMulticloudDataTransferSupportedServicesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMulticloudDataTransferSupportedServicesResponse {
pub multicloud_data_transfer_supported_services:
std::vec::Vec<crate::model::MulticloudDataTransferSupportedService>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMulticloudDataTransferSupportedServicesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_multicloud_data_transfer_supported_services<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MulticloudDataTransferSupportedService>,
{
use std::iter::Iterator;
self.multicloud_data_transfer_supported_services =
v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListMulticloudDataTransferSupportedServicesResponse
{
type PageItem = crate::model::MulticloudDataTransferSupportedService;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.multicloud_data_transfer_supported_services
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Hub {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub unique_id: std::string::String,
pub state: crate::model::State,
pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,
pub route_tables: std::vec::Vec<std::string::String>,
pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,
pub policy_mode: crate::model::PolicyMode,
pub preset_topology: crate::model::PresetTopology,
pub export_psc: std::option::Option<bool>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Hub {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.unique_id = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RoutingVPC>,
{
use std::iter::Iterator;
self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_route_tables<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.route_tables = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_spoke_summary<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SpokeSummary>,
{
self.spoke_summary = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_spoke_summary<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SpokeSummary>,
{
self.spoke_summary = v.map(|x| x.into());
self
}
pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
mut self,
v: T,
) -> Self {
self.policy_mode = v.into();
self
}
pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
mut self,
v: T,
) -> Self {
self.preset_topology = v.into();
self
}
pub fn set_export_psc<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.export_psc = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_export_psc<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<bool>,
{
self.export_psc = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Hub {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RoutingVPC {
pub uri: std::string::String,
pub required_for_new_site_to_site_data_transfer_spokes: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RoutingVPC {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.required_for_new_site_to_site_data_transfer_spokes = v.into();
self
}
}
impl wkt::message::Message for RoutingVPC {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Spoke {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub hub: std::string::String,
pub group: std::string::String,
pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,
pub linked_interconnect_attachments:
std::option::Option<crate::model::LinkedInterconnectAttachments>,
pub linked_router_appliance_instances:
std::option::Option<crate::model::LinkedRouterApplianceInstances>,
pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,
pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,
pub unique_id: std::string::String,
pub state: crate::model::State,
pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,
pub spoke_type: crate::model::SpokeType,
pub etag: std::string::String,
pub field_paths_pending_update: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Spoke {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.hub = v.into();
self
}
pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.group = v.into();
self
}
pub fn set_linked_vpn_tunnels<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LinkedVpnTunnels>,
{
self.linked_vpn_tunnels = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_linked_vpn_tunnels<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LinkedVpnTunnels>,
{
self.linked_vpn_tunnels = v.map(|x| x.into());
self
}
pub fn set_linked_interconnect_attachments<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
{
self.linked_interconnect_attachments = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_linked_interconnect_attachments<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
{
self.linked_interconnect_attachments = v.map(|x| x.into());
self
}
pub fn set_linked_router_appliance_instances<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
{
self.linked_router_appliance_instances = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_linked_router_appliance_instances<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
{
self.linked_router_appliance_instances = v.map(|x| x.into());
self
}
pub fn set_linked_vpc_network<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LinkedVpcNetwork>,
{
self.linked_vpc_network = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_linked_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LinkedVpcNetwork>,
{
self.linked_vpc_network = v.map(|x| x.into());
self
}
pub fn set_linked_producer_vpc_network<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
{
self.linked_producer_vpc_network = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_linked_producer_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
{
self.linked_producer_vpc_network = v.map(|x| x.into());
self
}
pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.unique_id = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_reasons<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::spoke::StateReason>,
{
use std::iter::Iterator;
self.reasons = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
self.spoke_type = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Spoke {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
}
}
pub mod spoke {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StateReason {
pub code: crate::model::spoke::state_reason::Code,
pub message: std::string::String,
pub user_details: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl StateReason {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
mut self,
v: T,
) -> Self {
self.code = v.into();
self
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_user_details<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.user_details = v.into();
self
}
}
impl wkt::message::Message for StateReason {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
}
}
pub mod state_reason {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Code {
Unspecified,
PendingReview,
Rejected,
Paused,
Failed,
UpdatePendingReview,
UpdateRejected,
UpdateFailed,
UnknownValue(code::UnknownValue),
}
#[doc(hidden)]
pub mod code {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Code {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::PendingReview => std::option::Option::Some(1),
Self::Rejected => std::option::Option::Some(2),
Self::Paused => std::option::Option::Some(3),
Self::Failed => std::option::Option::Some(4),
Self::UpdatePendingReview => std::option::Option::Some(5),
Self::UpdateRejected => std::option::Option::Some(6),
Self::UpdateFailed => std::option::Option::Some(7),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
Self::PendingReview => std::option::Option::Some("PENDING_REVIEW"),
Self::Rejected => std::option::Option::Some("REJECTED"),
Self::Paused => std::option::Option::Some("PAUSED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::UpdatePendingReview => std::option::Option::Some("UPDATE_PENDING_REVIEW"),
Self::UpdateRejected => std::option::Option::Some("UPDATE_REJECTED"),
Self::UpdateFailed => std::option::Option::Some("UPDATE_FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Code {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Code {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Code {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::PendingReview,
2 => Self::Rejected,
3 => Self::Paused,
4 => Self::Failed,
5 => Self::UpdatePendingReview,
6 => Self::UpdateRejected,
7 => Self::UpdateFailed,
_ => Self::UnknownValue(code::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Code {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CODE_UNSPECIFIED" => Self::Unspecified,
"PENDING_REVIEW" => Self::PendingReview,
"REJECTED" => Self::Rejected,
"PAUSED" => Self::Paused,
"FAILED" => Self::Failed,
"UPDATE_PENDING_REVIEW" => Self::UpdatePendingReview,
"UPDATE_REJECTED" => Self::UpdateRejected,
"UPDATE_FAILED" => Self::UpdateFailed,
_ => Self::UnknownValue(code::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Code {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::PendingReview => serializer.serialize_i32(1),
Self::Rejected => serializer.serialize_i32(2),
Self::Paused => serializer.serialize_i32(3),
Self::Failed => serializer.serialize_i32(4),
Self::UpdatePendingReview => serializer.serialize_i32(5),
Self::UpdateRejected => serializer.serialize_i32(6),
Self::UpdateFailed => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Code {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
".google.cloud.networkconnectivity.v1.Spoke.StateReason.Code",
))
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteTable {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub uid: std::string::String,
pub state: crate::model::State,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouteTable {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
}
impl wkt::message::Message for RouteTable {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Route {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub ip_cidr_range: std::string::String,
pub r#type: crate::model::RouteType,
pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub uid: std::string::String,
pub state: crate::model::State,
pub spoke: std::string::String,
pub location: std::string::String,
pub priority: i64,
pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,
pub next_hop_router_appliance_instance:
std::option::Option<crate::model::NextHopRouterApplianceInstance>,
pub next_hop_interconnect_attachment:
std::option::Option<crate::model::NextHopInterconnectAttachment>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Route {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ip_cidr_range = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_next_hop_vpc_network<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NextHopVpcNetwork>,
{
self.next_hop_vpc_network = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_next_hop_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NextHopVpcNetwork>,
{
self.next_hop_vpc_network = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.spoke = v.into();
self
}
pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location = v.into();
self
}
pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.priority = v.into();
self
}
pub fn set_next_hop_vpn_tunnel<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NextHopVPNTunnel>,
{
self.next_hop_vpn_tunnel = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_next_hop_vpn_tunnel<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NextHopVPNTunnel>,
{
self.next_hop_vpn_tunnel = v.map(|x| x.into());
self
}
pub fn set_next_hop_router_appliance_instance<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
{
self.next_hop_router_appliance_instance = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_next_hop_router_appliance_instance<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
{
self.next_hop_router_appliance_instance = v.map(|x| x.into());
self
}
pub fn set_next_hop_interconnect_attachment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
{
self.next_hop_interconnect_attachment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_next_hop_interconnect_attachment<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
{
self.next_hop_interconnect_attachment = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Route {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Group {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub uid: std::string::String,
pub state: crate::model::State,
pub auto_accept: std::option::Option<crate::model::AutoAccept>,
pub route_table: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Group {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_auto_accept<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AutoAccept>,
{
self.auto_accept = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_auto_accept<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AutoAccept>,
{
self.auto_accept = v.map(|x| x.into());
self
}
pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.route_table = v.into();
self
}
}
impl wkt::message::Message for Group {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutoAccept {
pub auto_accept_projects: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AutoAccept {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AutoAccept {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHubsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListHubsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListHubsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHubsResponse {
pub hubs: std::vec::Vec<crate::model::Hub>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListHubsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_hubs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Hub>,
{
use std::iter::Iterator;
self.hubs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListHubsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListHubsResponse {
type PageItem = crate::model::Hub;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.hubs
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetHubRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetHubRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetHubRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateHubRequest {
pub parent: std::string::String,
pub hub_id: std::string::String,
pub hub: std::option::Option<crate::model::Hub>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateHubRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.hub_id = v.into();
self
}
pub fn set_hub<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Hub>,
{
self.hub = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Hub>,
{
self.hub = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateHubRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateHubRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub hub: std::option::Option<crate::model::Hub>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateHubRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_hub<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Hub>,
{
self.hub = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Hub>,
{
self.hub = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateHubRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteHubRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteHubRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for DeleteHubRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHubSpokesRequest {
pub name: std::string::String,
pub spoke_locations: std::vec::Vec<std::string::String>,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub view: crate::model::list_hub_spokes_request::SpokeView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListHubSpokesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for ListHubSpokesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
}
}
pub mod list_hub_spokes_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SpokeView {
Unspecified,
Basic,
Detailed,
UnknownValue(spoke_view::UnknownValue),
}
#[doc(hidden)]
pub mod spoke_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SpokeView {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Basic => std::option::Option::Some(1),
Self::Detailed => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SPOKE_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("BASIC"),
Self::Detailed => std::option::Option::Some("DETAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SpokeView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SpokeView {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SpokeView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Detailed,
_ => Self::UnknownValue(spoke_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SpokeView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SPOKE_VIEW_UNSPECIFIED" => Self::Unspecified,
"BASIC" => Self::Basic,
"DETAILED" => Self::Detailed,
_ => Self::UnknownValue(spoke_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SpokeView {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Basic => serializer.serialize_i32(1),
Self::Detailed => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SpokeView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeView>::new(
".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHubSpokesResponse {
pub spokes: std::vec::Vec<crate::model::Spoke>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListHubSpokesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_spokes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Spoke>,
{
use std::iter::Iterator;
self.spokes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListHubSpokesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
type PageItem = crate::model::Spoke;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.spokes
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryHubStatusRequest {
pub name: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub group_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QueryHubStatusRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.group_by = v.into();
self
}
}
impl wkt::message::Message for QueryHubStatusRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryHubStatusResponse {
pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QueryHubStatusResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::HubStatusEntry>,
{
use std::iter::Iterator;
self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for QueryHubStatusResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
type PageItem = crate::model::HubStatusEntry;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.hub_status_entries
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HubStatusEntry {
pub count: i32,
pub group_by: std::string::String,
pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl HubStatusEntry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.count = v.into();
self
}
pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.group_by = v.into();
self
}
pub fn set_psc_propagation_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PscPropagationStatus>,
{
self.psc_propagation_status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_psc_propagation_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PscPropagationStatus>,
{
self.psc_propagation_status = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for HubStatusEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PscPropagationStatus {
pub source_spoke: std::string::String,
pub source_group: std::string::String,
pub source_forwarding_rule: std::string::String,
pub target_spoke: std::string::String,
pub target_group: std::string::String,
pub code: crate::model::psc_propagation_status::Code,
pub message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PscPropagationStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_spoke = v.into();
self
}
pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_group = v.into();
self
}
pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.source_forwarding_rule = v.into();
self
}
pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_spoke = v.into();
self
}
pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_group = v.into();
self
}
pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
mut self,
v: T,
) -> Self {
self.code = v.into();
self
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
}
impl wkt::message::Message for PscPropagationStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
}
}
pub mod psc_propagation_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Code {
Unspecified,
Ready,
Propagating,
ErrorProducerPropagatedConnectionLimitExceeded,
ErrorProducerNatIpSpaceExhausted,
ErrorProducerQuotaExceeded,
ErrorConsumerQuotaExceeded,
UnknownValue(code::UnknownValue),
}
#[doc(hidden)]
pub mod code {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Code {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Ready => std::option::Option::Some(1),
Self::Propagating => std::option::Option::Some(2),
Self::ErrorProducerPropagatedConnectionLimitExceeded => {
std::option::Option::Some(3)
}
Self::ErrorProducerNatIpSpaceExhausted => std::option::Option::Some(4),
Self::ErrorProducerQuotaExceeded => std::option::Option::Some(5),
Self::ErrorConsumerQuotaExceeded => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
Self::Ready => std::option::Option::Some("READY"),
Self::Propagating => std::option::Option::Some("PROPAGATING"),
Self::ErrorProducerPropagatedConnectionLimitExceeded => {
std::option::Option::Some("ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED")
}
Self::ErrorProducerNatIpSpaceExhausted => {
std::option::Option::Some("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED")
}
Self::ErrorProducerQuotaExceeded => {
std::option::Option::Some("ERROR_PRODUCER_QUOTA_EXCEEDED")
}
Self::ErrorConsumerQuotaExceeded => {
std::option::Option::Some("ERROR_CONSUMER_QUOTA_EXCEEDED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Code {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Code {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Code {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Ready,
2 => Self::Propagating,
3 => Self::ErrorProducerPropagatedConnectionLimitExceeded,
4 => Self::ErrorProducerNatIpSpaceExhausted,
5 => Self::ErrorProducerQuotaExceeded,
6 => Self::ErrorConsumerQuotaExceeded,
_ => Self::UnknownValue(code::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Code {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CODE_UNSPECIFIED" => Self::Unspecified,
"READY" => Self::Ready,
"PROPAGATING" => Self::Propagating,
"ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => {
Self::ErrorProducerPropagatedConnectionLimitExceeded
}
"ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => Self::ErrorProducerNatIpSpaceExhausted,
"ERROR_PRODUCER_QUOTA_EXCEEDED" => Self::ErrorProducerQuotaExceeded,
"ERROR_CONSUMER_QUOTA_EXCEEDED" => Self::ErrorConsumerQuotaExceeded,
_ => Self::UnknownValue(code::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Code {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Ready => serializer.serialize_i32(1),
Self::Propagating => serializer.serialize_i32(2),
Self::ErrorProducerPropagatedConnectionLimitExceeded => serializer.serialize_i32(3),
Self::ErrorProducerNatIpSpaceExhausted => serializer.serialize_i32(4),
Self::ErrorProducerQuotaExceeded => serializer.serialize_i32(5),
Self::ErrorConsumerQuotaExceeded => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Code {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
".google.cloud.networkconnectivity.v1.PscPropagationStatus.Code",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSpokesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSpokesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListSpokesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSpokesResponse {
pub spokes: std::vec::Vec<crate::model::Spoke>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSpokesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_spokes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Spoke>,
{
use std::iter::Iterator;
self.spokes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListSpokesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSpokesResponse {
type PageItem = crate::model::Spoke;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.spokes
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSpokeRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSpokeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetSpokeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSpokeRequest {
pub parent: std::string::String,
pub spoke_id: std::string::String,
pub spoke: std::option::Option<crate::model::Spoke>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSpokeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.spoke_id = v.into();
self
}
pub fn set_spoke<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Spoke>,
{
self.spoke = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Spoke>,
{
self.spoke = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateSpokeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSpokeRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub spoke: std::option::Option<crate::model::Spoke>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSpokeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_spoke<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Spoke>,
{
self.spoke = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Spoke>,
{
self.spoke = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateSpokeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSpokeRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteSpokeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for DeleteSpokeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AcceptHubSpokeRequest {
pub name: std::string::String,
pub spoke_uri: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AcceptHubSpokeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.spoke_uri = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for AcceptHubSpokeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AcceptHubSpokeResponse {
pub spoke: std::option::Option<crate::model::Spoke>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AcceptHubSpokeResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_spoke<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Spoke>,
{
self.spoke = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Spoke>,
{
self.spoke = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AcceptHubSpokeResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RejectHubSpokeRequest {
pub name: std::string::String,
pub spoke_uri: std::string::String,
pub request_id: std::string::String,
pub details: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RejectHubSpokeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.spoke_uri = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.details = v.into();
self
}
}
impl wkt::message::Message for RejectHubSpokeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RejectHubSpokeResponse {
pub spoke: std::option::Option<crate::model::Spoke>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RejectHubSpokeResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_spoke<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Spoke>,
{
self.spoke = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Spoke>,
{
self.spoke = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RejectHubSpokeResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AcceptSpokeUpdateRequest {
pub name: std::string::String,
pub spoke_uri: std::string::String,
pub spoke_etag: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AcceptSpokeUpdateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.spoke_uri = v.into();
self
}
pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.spoke_etag = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for AcceptSpokeUpdateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AcceptSpokeUpdateResponse {
pub spoke: std::option::Option<crate::model::Spoke>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AcceptSpokeUpdateResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_spoke<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Spoke>,
{
self.spoke = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Spoke>,
{
self.spoke = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AcceptSpokeUpdateResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RejectSpokeUpdateRequest {
pub name: std::string::String,
pub spoke_uri: std::string::String,
pub spoke_etag: std::string::String,
pub details: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RejectSpokeUpdateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.spoke_uri = v.into();
self
}
pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.spoke_etag = v.into();
self
}
pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.details = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for RejectSpokeUpdateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RejectSpokeUpdateResponse {
pub spoke: std::option::Option<crate::model::Spoke>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RejectSpokeUpdateResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_spoke<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Spoke>,
{
self.spoke = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Spoke>,
{
self.spoke = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RejectSpokeUpdateResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRouteTableRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRouteTableRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetRouteTableRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRouteRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRouteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetRouteRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRoutesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRoutesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListRoutesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRoutesResponse {
pub routes: std::vec::Vec<crate::model::Route>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRoutesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_routes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Route>,
{
use std::iter::Iterator;
self.routes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListRoutesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListRoutesResponse {
type PageItem = crate::model::Route;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.routes
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRouteTablesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRouteTablesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListRouteTablesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRouteTablesResponse {
pub route_tables: std::vec::Vec<crate::model::RouteTable>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRouteTablesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_route_tables<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RouteTable>,
{
use std::iter::Iterator;
self.route_tables = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListRouteTablesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
type PageItem = crate::model::RouteTable;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.route_tables
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGroupsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListGroupsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListGroupsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGroupsResponse {
pub groups: std::vec::Vec<crate::model::Group>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListGroupsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_groups<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Group>,
{
use std::iter::Iterator;
self.groups = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListGroupsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListGroupsResponse {
type PageItem = crate::model::Group;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.groups
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LinkedVpnTunnels {
pub uris: std::vec::Vec<std::string::String>,
pub site_to_site_data_transfer: bool,
pub vpc_network: std::string::String,
pub include_import_ranges: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LinkedVpnTunnels {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.site_to_site_data_transfer = v.into();
self
}
pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vpc_network = v.into();
self
}
pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for LinkedVpnTunnels {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LinkedInterconnectAttachments {
pub uris: std::vec::Vec<std::string::String>,
pub site_to_site_data_transfer: bool,
pub vpc_network: std::string::String,
pub include_import_ranges: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LinkedInterconnectAttachments {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uris<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.uris = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.site_to_site_data_transfer = v.into();
self
}
pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vpc_network = v.into();
self
}
pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for LinkedInterconnectAttachments {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LinkedRouterApplianceInstances {
pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,
pub site_to_site_data_transfer: bool,
pub vpc_network: std::string::String,
pub include_import_ranges: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LinkedRouterApplianceInstances {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_instances<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RouterApplianceInstance>,
{
use std::iter::Iterator;
self.instances = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.site_to_site_data_transfer = v.into();
self
}
pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vpc_network = v.into();
self
}
pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for LinkedRouterApplianceInstances {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LinkedVpcNetwork {
pub uri: std::string::String,
pub exclude_export_ranges: std::vec::Vec<std::string::String>,
pub include_export_ranges: std::vec::Vec<std::string::String>,
pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
pub producer_vpc_spokes: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LinkedVpcNetwork {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for LinkedVpcNetwork {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LinkedProducerVpcNetwork {
pub network: std::string::String,
pub service_consumer_vpc_spoke: std::string::String,
pub peering: std::string::String,
pub producer_network: std::string::String,
pub exclude_export_ranges: std::vec::Vec<std::string::String>,
pub include_export_ranges: std::vec::Vec<std::string::String>,
pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,
pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LinkedProducerVpcNetwork {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_consumer_vpc_spoke = v.into();
self
}
pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.peering = v.into();
self
}
pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.producer_network = v.into();
self
}
pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for LinkedProducerVpcNetwork {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouterApplianceInstance {
pub virtual_machine: std::string::String,
pub ip_address: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RouterApplianceInstance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.virtual_machine = v.into();
self
}
pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ip_address = v.into();
self
}
}
impl wkt::message::Message for RouterApplianceInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LocationMetadata {
pub location_features: std::vec::Vec<crate::model::LocationFeature>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LocationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_location_features<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LocationFeature>,
{
use std::iter::Iterator;
self.location_features = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for LocationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NextHopVpcNetwork {
pub uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NextHopVpcNetwork {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
}
impl wkt::message::Message for NextHopVpcNetwork {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NextHopVPNTunnel {
pub uri: std::string::String,
pub vpc_network: std::string::String,
pub site_to_site_data_transfer: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NextHopVPNTunnel {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vpc_network = v.into();
self
}
pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.site_to_site_data_transfer = v.into();
self
}
}
impl wkt::message::Message for NextHopVPNTunnel {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NextHopRouterApplianceInstance {
pub uri: std::string::String,
pub vpc_network: std::string::String,
pub site_to_site_data_transfer: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NextHopRouterApplianceInstance {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vpc_network = v.into();
self
}
pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.site_to_site_data_transfer = v.into();
self
}
}
impl wkt::message::Message for NextHopRouterApplianceInstance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NextHopInterconnectAttachment {
pub uri: std::string::String,
pub vpc_network: std::string::String,
pub site_to_site_data_transfer: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NextHopInterconnectAttachment {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.vpc_network = v.into();
self
}
pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.site_to_site_data_transfer = v.into();
self
}
}
impl wkt::message::Message for NextHopInterconnectAttachment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpokeSummary {
pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,
pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,
pub spoke_state_reason_counts:
std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpokeSummary {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
{
use std::iter::Iterator;
self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
{
use std::iter::Iterator;
self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
{
use std::iter::Iterator;
self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SpokeSummary {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
}
}
pub mod spoke_summary {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpokeTypeCount {
pub spoke_type: crate::model::SpokeType,
pub count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpokeTypeCount {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
mut self,
v: T,
) -> Self {
self.spoke_type = v.into();
self
}
pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.count = v.into();
self
}
}
impl wkt::message::Message for SpokeTypeCount {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpokeStateCount {
pub state: crate::model::State,
pub count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpokeStateCount {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.count = v.into();
self
}
}
impl wkt::message::Message for SpokeStateCount {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpokeStateReasonCount {
pub state_reason_code: crate::model::spoke::state_reason::Code,
pub count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpokeStateReasonCount {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_state_reason_code<
T: std::convert::Into<crate::model::spoke::state_reason::Code>,
>(
mut self,
v: T,
) -> Self {
self.state_reason_code = v.into();
self
}
pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.count = v.into();
self
}
}
impl wkt::message::Message for SpokeStateReasonCount {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetGroupRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetGroupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateGroupRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub group: std::option::Option<crate::model::Group>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateGroupRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_group<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Group>,
{
self.group = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Group>,
{
self.group = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateGroupRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InternalRange {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub ip_cidr_range: std::string::String,
pub network: std::string::String,
pub usage: crate::model::internal_range::Usage,
pub peering: crate::model::internal_range::Peering,
pub prefix_length: i32,
pub target_cidr_range: std::vec::Vec<std::string::String>,
pub users: std::vec::Vec<std::string::String>,
pub overlaps: std::vec::Vec<crate::model::internal_range::Overlap>,
pub migration: std::option::Option<crate::model::internal_range::Migration>,
pub immutable: bool,
pub allocation_options: std::option::Option<crate::model::internal_range::AllocationOptions>,
pub exclude_cidr_ranges: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InternalRange {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ip_cidr_range = v.into();
self
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_usage<T: std::convert::Into<crate::model::internal_range::Usage>>(
mut self,
v: T,
) -> Self {
self.usage = v.into();
self
}
pub fn set_peering<T: std::convert::Into<crate::model::internal_range::Peering>>(
mut self,
v: T,
) -> Self {
self.peering = v.into();
self
}
pub fn set_prefix_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.prefix_length = v.into();
self
}
pub fn set_target_cidr_range<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.target_cidr_range = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_users<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.users = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_overlaps<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::internal_range::Overlap>,
{
use std::iter::Iterator;
self.overlaps = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_migration<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::internal_range::Migration>,
{
self.migration = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_migration<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::internal_range::Migration>,
{
self.migration = v.map(|x| x.into());
self
}
pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.immutable = v.into();
self
}
pub fn set_allocation_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
{
self.allocation_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_allocation_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
{
self.allocation_options = v.map(|x| x.into());
self
}
pub fn set_exclude_cidr_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.exclude_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for InternalRange {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange"
}
}
pub mod internal_range {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Migration {
pub source: std::string::String,
pub target: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Migration {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source = v.into();
self
}
pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target = v.into();
self
}
}
impl wkt::message::Message for Migration {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.Migration"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AllocationOptions {
pub allocation_strategy: crate::model::internal_range::AllocationStrategy,
pub first_available_ranges_lookup_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AllocationOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_allocation_strategy<
T: std::convert::Into<crate::model::internal_range::AllocationStrategy>,
>(
mut self,
v: T,
) -> Self {
self.allocation_strategy = v.into();
self
}
pub fn set_first_available_ranges_lookup_size<T: std::convert::Into<i32>>(
mut self,
v: T,
) -> Self {
self.first_available_ranges_lookup_size = v.into();
self
}
}
impl wkt::message::Message for AllocationOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.AllocationOptions"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Usage {
Unspecified,
ForVpc,
ExternalToVpc,
ForMigration,
UnknownValue(usage::UnknownValue),
}
#[doc(hidden)]
pub mod usage {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Usage {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ForVpc => std::option::Option::Some(1),
Self::ExternalToVpc => std::option::Option::Some(2),
Self::ForMigration => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("USAGE_UNSPECIFIED"),
Self::ForVpc => std::option::Option::Some("FOR_VPC"),
Self::ExternalToVpc => std::option::Option::Some("EXTERNAL_TO_VPC"),
Self::ForMigration => std::option::Option::Some("FOR_MIGRATION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Usage {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Usage {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Usage {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ForVpc,
2 => Self::ExternalToVpc,
3 => Self::ForMigration,
_ => Self::UnknownValue(usage::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Usage {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"USAGE_UNSPECIFIED" => Self::Unspecified,
"FOR_VPC" => Self::ForVpc,
"EXTERNAL_TO_VPC" => Self::ExternalToVpc,
"FOR_MIGRATION" => Self::ForMigration,
_ => Self::UnknownValue(usage::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Usage {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ForVpc => serializer.serialize_i32(1),
Self::ExternalToVpc => serializer.serialize_i32(2),
Self::ForMigration => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Usage {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Usage>::new(
".google.cloud.networkconnectivity.v1.InternalRange.Usage",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Peering {
Unspecified,
ForSelf,
ForPeer,
NotShared,
UnknownValue(peering::UnknownValue),
}
#[doc(hidden)]
pub mod peering {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Peering {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ForSelf => std::option::Option::Some(1),
Self::ForPeer => std::option::Option::Some(2),
Self::NotShared => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PEERING_UNSPECIFIED"),
Self::ForSelf => std::option::Option::Some("FOR_SELF"),
Self::ForPeer => std::option::Option::Some("FOR_PEER"),
Self::NotShared => std::option::Option::Some("NOT_SHARED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Peering {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Peering {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Peering {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ForSelf,
2 => Self::ForPeer,
3 => Self::NotShared,
_ => Self::UnknownValue(peering::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Peering {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PEERING_UNSPECIFIED" => Self::Unspecified,
"FOR_SELF" => Self::ForSelf,
"FOR_PEER" => Self::ForPeer,
"NOT_SHARED" => Self::NotShared,
_ => Self::UnknownValue(peering::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Peering {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ForSelf => serializer.serialize_i32(1),
Self::ForPeer => serializer.serialize_i32(2),
Self::NotShared => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Peering {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Peering>::new(
".google.cloud.networkconnectivity.v1.InternalRange.Peering",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Overlap {
Unspecified,
RouteRange,
ExistingSubnetRange,
UnknownValue(overlap::UnknownValue),
}
#[doc(hidden)]
pub mod overlap {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Overlap {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::RouteRange => std::option::Option::Some(1),
Self::ExistingSubnetRange => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("OVERLAP_UNSPECIFIED"),
Self::RouteRange => std::option::Option::Some("OVERLAP_ROUTE_RANGE"),
Self::ExistingSubnetRange => {
std::option::Option::Some("OVERLAP_EXISTING_SUBNET_RANGE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Overlap {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Overlap {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Overlap {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::RouteRange,
2 => Self::ExistingSubnetRange,
_ => Self::UnknownValue(overlap::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Overlap {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OVERLAP_UNSPECIFIED" => Self::Unspecified,
"OVERLAP_ROUTE_RANGE" => Self::RouteRange,
"OVERLAP_EXISTING_SUBNET_RANGE" => Self::ExistingSubnetRange,
_ => Self::UnknownValue(overlap::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Overlap {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::RouteRange => serializer.serialize_i32(1),
Self::ExistingSubnetRange => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Overlap {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Overlap>::new(
".google.cloud.networkconnectivity.v1.InternalRange.Overlap",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AllocationStrategy {
Unspecified,
Random,
FirstAvailable,
RandomFirstNAvailable,
FirstSmallestFitting,
UnknownValue(allocation_strategy::UnknownValue),
}
#[doc(hidden)]
pub mod allocation_strategy {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AllocationStrategy {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Random => std::option::Option::Some(1),
Self::FirstAvailable => std::option::Option::Some(2),
Self::RandomFirstNAvailable => std::option::Option::Some(3),
Self::FirstSmallestFitting => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ALLOCATION_STRATEGY_UNSPECIFIED"),
Self::Random => std::option::Option::Some("RANDOM"),
Self::FirstAvailable => std::option::Option::Some("FIRST_AVAILABLE"),
Self::RandomFirstNAvailable => {
std::option::Option::Some("RANDOM_FIRST_N_AVAILABLE")
}
Self::FirstSmallestFitting => std::option::Option::Some("FIRST_SMALLEST_FITTING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AllocationStrategy {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AllocationStrategy {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for AllocationStrategy {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Random,
2 => Self::FirstAvailable,
3 => Self::RandomFirstNAvailable,
4 => Self::FirstSmallestFitting,
_ => Self::UnknownValue(allocation_strategy::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AllocationStrategy {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ALLOCATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
"RANDOM" => Self::Random,
"FIRST_AVAILABLE" => Self::FirstAvailable,
"RANDOM_FIRST_N_AVAILABLE" => Self::RandomFirstNAvailable,
"FIRST_SMALLEST_FITTING" => Self::FirstSmallestFitting,
_ => Self::UnknownValue(allocation_strategy::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AllocationStrategy {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Random => serializer.serialize_i32(1),
Self::FirstAvailable => serializer.serialize_i32(2),
Self::RandomFirstNAvailable => serializer.serialize_i32(3),
Self::FirstSmallestFitting => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AllocationStrategy {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AllocationStrategy>::new(
".google.cloud.networkconnectivity.v1.InternalRange.AllocationStrategy",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInternalRangesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListInternalRangesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListInternalRangesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInternalRangesResponse {
pub internal_ranges: std::vec::Vec<crate::model::InternalRange>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListInternalRangesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_internal_ranges<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::InternalRange>,
{
use std::iter::Iterator;
self.internal_ranges = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListInternalRangesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListInternalRangesResponse {
type PageItem = crate::model::InternalRange;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.internal_ranges
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetInternalRangeRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetInternalRangeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetInternalRangeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetInternalRangeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateInternalRangeRequest {
pub parent: std::string::String,
pub internal_range_id: std::string::String,
pub internal_range: std::option::Option<crate::model::InternalRange>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateInternalRangeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_internal_range_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.internal_range_id = v.into();
self
}
pub fn set_internal_range<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InternalRange>,
{
self.internal_range = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InternalRange>,
{
self.internal_range = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateInternalRangeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.CreateInternalRangeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateInternalRangeRequest {
pub update_mask: std::option::Option<wkt::FieldMask>,
pub internal_range: std::option::Option<crate::model::InternalRange>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateInternalRangeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_internal_range<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InternalRange>,
{
self.internal_range = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InternalRange>,
{
self.internal_range = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for UpdateInternalRangeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateInternalRangeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteInternalRangeRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteInternalRangeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for DeleteInternalRangeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteInternalRangeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolicyBasedRoute {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub description: std::string::String,
pub network: std::string::String,
pub filter: std::option::Option<crate::model::policy_based_route::Filter>,
pub priority: i32,
pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,
pub self_link: std::string::String,
pub kind: std::string::String,
pub target: std::option::Option<crate::model::policy_based_route::Target>,
pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PolicyBasedRoute {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.network = v.into();
self
}
pub fn set_filter<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::policy_based_route::Filter>,
{
self.filter = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::policy_based_route::Filter>,
{
self.filter = v.map(|x| x.into());
self
}
pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.priority = v.into();
self
}
pub fn set_warnings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::policy_based_route::Warnings>,
{
use std::iter::Iterator;
self.warnings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.self_link = v.into();
self
}
pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kind = v.into();
self
}
pub fn set_target<
T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
>(
mut self,
v: T,
) -> Self {
self.target = v.into();
self
}
pub fn virtual_machine(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
{
#[allow(unreachable_patterns)]
self.target.as_ref().and_then(|v| match v {
crate::model::policy_based_route::Target::VirtualMachine(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_virtual_machine<
T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
>(
mut self,
v: T,
) -> Self {
self.target = std::option::Option::Some(
crate::model::policy_based_route::Target::VirtualMachine(v.into()),
);
self
}
pub fn interconnect_attachment(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
> {
#[allow(unreachable_patterns)]
self.target.as_ref().and_then(|v| match v {
crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_interconnect_attachment<
T: std::convert::Into<
std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
>,
>(
mut self,
v: T,
) -> Self {
self.target = std::option::Option::Some(
crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
);
self
}
pub fn set_next_hop<
T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
>(
mut self,
v: T,
) -> Self {
self.next_hop = v.into();
self
}
pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.next_hop.as_ref().and_then(|v| match v {
crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_hop = std::option::Option::Some(
crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
);
self
}
pub fn next_hop_other_routes(
&self,
) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
#[allow(unreachable_patterns)]
self.next_hop.as_ref().and_then(|v| match v {
crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_next_hop_other_routes<
T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
>(
mut self,
v: T,
) -> Self {
self.next_hop = std::option::Option::Some(
crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
);
self
}
}
impl wkt::message::Message for PolicyBasedRoute {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
}
}
pub mod policy_based_route {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VirtualMachine {
pub tags: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VirtualMachine {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.tags = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for VirtualMachine {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InterconnectAttachment {
pub region: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InterconnectAttachment {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.region = v.into();
self
}
}
impl wkt::message::Message for InterconnectAttachment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Filter {
pub ip_protocol: std::string::String,
pub src_range: std::string::String,
pub dest_range: std::string::String,
pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Filter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.ip_protocol = v.into();
self
}
pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.src_range = v.into();
self
}
pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dest_range = v.into();
self
}
pub fn set_protocol_version<
T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
>(
mut self,
v: T,
) -> Self {
self.protocol_version = v.into();
self
}
}
impl wkt::message::Message for Filter {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
}
}
pub mod filter {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ProtocolVersion {
Unspecified,
Ipv4,
UnknownValue(protocol_version::UnknownValue),
}
#[doc(hidden)]
pub mod protocol_version {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ProtocolVersion {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Ipv4 => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PROTOCOL_VERSION_UNSPECIFIED"),
Self::Ipv4 => std::option::Option::Some("IPV4"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ProtocolVersion {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ProtocolVersion {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ProtocolVersion {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Ipv4,
_ => Self::UnknownValue(protocol_version::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ProtocolVersion {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PROTOCOL_VERSION_UNSPECIFIED" => Self::Unspecified,
"IPV4" => Self::Ipv4,
_ => Self::UnknownValue(protocol_version::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ProtocolVersion {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Ipv4 => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ProtocolVersion {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtocolVersion>::new(
".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Warnings {
pub code: crate::model::policy_based_route::warnings::Code,
pub data: std::collections::HashMap<std::string::String, std::string::String>,
pub warning_message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Warnings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
mut self,
v: T,
) -> Self {
self.code = v.into();
self
}
pub fn set_data<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.warning_message = v.into();
self
}
}
impl wkt::message::Message for Warnings {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
}
}
pub mod warnings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Code {
WarningUnspecified,
ResourceNotActive,
ResourceBeingModified,
UnknownValue(code::UnknownValue),
}
#[doc(hidden)]
pub mod code {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Code {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::WarningUnspecified => std::option::Option::Some(0),
Self::ResourceNotActive => std::option::Option::Some(1),
Self::ResourceBeingModified => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::WarningUnspecified => std::option::Option::Some("WARNING_UNSPECIFIED"),
Self::ResourceNotActive => std::option::Option::Some("RESOURCE_NOT_ACTIVE"),
Self::ResourceBeingModified => {
std::option::Option::Some("RESOURCE_BEING_MODIFIED")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Code {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Code {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Code {
fn from(value: i32) -> Self {
match value {
0 => Self::WarningUnspecified,
1 => Self::ResourceNotActive,
2 => Self::ResourceBeingModified,
_ => Self::UnknownValue(code::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Code {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"WARNING_UNSPECIFIED" => Self::WarningUnspecified,
"RESOURCE_NOT_ACTIVE" => Self::ResourceNotActive,
"RESOURCE_BEING_MODIFIED" => Self::ResourceBeingModified,
_ => Self::UnknownValue(code::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Code {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::WarningUnspecified => serializer.serialize_i32(0),
Self::ResourceNotActive => serializer.serialize_i32(1),
Self::ResourceBeingModified => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Code {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code",
))
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OtherRoutes {
Unspecified,
DefaultRouting,
UnknownValue(other_routes::UnknownValue),
}
#[doc(hidden)]
pub mod other_routes {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl OtherRoutes {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::DefaultRouting => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("OTHER_ROUTES_UNSPECIFIED"),
Self::DefaultRouting => std::option::Option::Some("DEFAULT_ROUTING"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for OtherRoutes {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for OtherRoutes {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for OtherRoutes {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::DefaultRouting,
_ => Self::UnknownValue(other_routes::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for OtherRoutes {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OTHER_ROUTES_UNSPECIFIED" => Self::Unspecified,
"DEFAULT_ROUTING" => Self::DefaultRouting,
_ => Self::UnknownValue(other_routes::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for OtherRoutes {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::DefaultRouting => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for OtherRoutes {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<OtherRoutes>::new(
".google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Target {
VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
InterconnectAttachment(
std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum NextHop {
NextHopIlbIp(std::string::String),
NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPolicyBasedRoutesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListPolicyBasedRoutesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListPolicyBasedRoutesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPolicyBasedRoutesResponse {
pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,
pub next_page_token: std::string::String,
pub unreachable: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListPolicyBasedRoutesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PolicyBasedRoute>,
{
use std::iter::Iterator;
self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_unreachable<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.unreachable = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListPolicyBasedRoutesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
type PageItem = crate::model::PolicyBasedRoute;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.policy_based_routes
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetPolicyBasedRouteRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetPolicyBasedRouteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetPolicyBasedRouteRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatePolicyBasedRouteRequest {
pub parent: std::string::String,
pub policy_based_route_id: std::string::String,
pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreatePolicyBasedRouteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.policy_based_route_id = v.into();
self
}
pub fn set_policy_based_route<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PolicyBasedRoute>,
{
self.policy_based_route = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PolicyBasedRoute>,
{
self.policy_based_route = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreatePolicyBasedRouteRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeletePolicyBasedRouteRequest {
pub name: std::string::String,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeletePolicyBasedRouteRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for DeletePolicyBasedRouteRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Infrastructure {
Unspecified,
Psc,
UnknownValue(infrastructure::UnknownValue),
}
#[doc(hidden)]
pub mod infrastructure {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Infrastructure {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Psc => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("INFRASTRUCTURE_UNSPECIFIED"),
Self::Psc => std::option::Option::Some("PSC"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Infrastructure {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Infrastructure {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Infrastructure {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Psc,
_ => Self::UnknownValue(infrastructure::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Infrastructure {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"INFRASTRUCTURE_UNSPECIFIED" => Self::Unspecified,
"PSC" => Self::Psc,
_ => Self::UnknownValue(infrastructure::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Infrastructure {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Psc => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Infrastructure {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Infrastructure>::new(
".google.cloud.networkconnectivity.v1.Infrastructure",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ConnectionErrorType {
Unspecified,
ErrorInternal,
ErrorConsumerSide,
ErrorProducerSide,
UnknownValue(connection_error_type::UnknownValue),
}
#[doc(hidden)]
pub mod connection_error_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ConnectionErrorType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ErrorInternal => std::option::Option::Some(1),
Self::ErrorConsumerSide => std::option::Option::Some(2),
Self::ErrorProducerSide => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
Self::ErrorInternal => std::option::Option::Some("ERROR_INTERNAL"),
Self::ErrorConsumerSide => std::option::Option::Some("ERROR_CONSUMER_SIDE"),
Self::ErrorProducerSide => std::option::Option::Some("ERROR_PRODUCER_SIDE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ConnectionErrorType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ConnectionErrorType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ConnectionErrorType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ErrorInternal,
2 => Self::ErrorConsumerSide,
3 => Self::ErrorProducerSide,
_ => Self::UnknownValue(connection_error_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ConnectionErrorType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"CONNECTION_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
"ERROR_INTERNAL" => Self::ErrorInternal,
"ERROR_CONSUMER_SIDE" => Self::ErrorConsumerSide,
"ERROR_PRODUCER_SIDE" => Self::ErrorProducerSide,
_ => Self::UnknownValue(connection_error_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ConnectionErrorType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ErrorInternal => serializer.serialize_i32(1),
Self::ErrorConsumerSide => serializer.serialize_i32(2),
Self::ErrorProducerSide => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ConnectionErrorType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionErrorType>::new(
".google.cloud.networkconnectivity.v1.ConnectionErrorType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum IPVersion {
Unspecified,
Ipv4,
Ipv6,
UnknownValue(ip_version::UnknownValue),
}
#[doc(hidden)]
pub mod ip_version {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl IPVersion {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Ipv4 => std::option::Option::Some(1),
Self::Ipv6 => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("IP_VERSION_UNSPECIFIED"),
Self::Ipv4 => std::option::Option::Some("IPV4"),
Self::Ipv6 => std::option::Option::Some("IPV6"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for IPVersion {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for IPVersion {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for IPVersion {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Ipv4,
2 => Self::Ipv6,
_ => Self::UnknownValue(ip_version::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for IPVersion {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"IP_VERSION_UNSPECIFIED" => Self::Unspecified,
"IPV4" => Self::Ipv4,
"IPV6" => Self::Ipv6,
_ => Self::UnknownValue(ip_version::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for IPVersion {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Ipv4 => serializer.serialize_i32(1),
Self::Ipv6 => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for IPVersion {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPVersion>::new(
".google.cloud.networkconnectivity.v1.IPVersion",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LocationFeature {
Unspecified,
SiteToCloudSpokes,
SiteToSiteSpokes,
UnknownValue(location_feature::UnknownValue),
}
#[doc(hidden)]
pub mod location_feature {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl LocationFeature {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::SiteToCloudSpokes => std::option::Option::Some(1),
Self::SiteToSiteSpokes => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("LOCATION_FEATURE_UNSPECIFIED"),
Self::SiteToCloudSpokes => std::option::Option::Some("SITE_TO_CLOUD_SPOKES"),
Self::SiteToSiteSpokes => std::option::Option::Some("SITE_TO_SITE_SPOKES"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for LocationFeature {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for LocationFeature {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for LocationFeature {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::SiteToCloudSpokes,
2 => Self::SiteToSiteSpokes,
_ => Self::UnknownValue(location_feature::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for LocationFeature {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"LOCATION_FEATURE_UNSPECIFIED" => Self::Unspecified,
"SITE_TO_CLOUD_SPOKES" => Self::SiteToCloudSpokes,
"SITE_TO_SITE_SPOKES" => Self::SiteToSiteSpokes,
_ => Self::UnknownValue(location_feature::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for LocationFeature {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::SiteToCloudSpokes => serializer.serialize_i32(1),
Self::SiteToSiteSpokes => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for LocationFeature {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationFeature>::new(
".google.cloud.networkconnectivity.v1.LocationFeature",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RouteType {
Unspecified,
VpcPrimarySubnet,
VpcSecondarySubnet,
DynamicRoute,
UnknownValue(route_type::UnknownValue),
}
#[doc(hidden)]
pub mod route_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RouteType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::VpcPrimarySubnet => std::option::Option::Some(1),
Self::VpcSecondarySubnet => std::option::Option::Some(2),
Self::DynamicRoute => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
Self::VpcPrimarySubnet => std::option::Option::Some("VPC_PRIMARY_SUBNET"),
Self::VpcSecondarySubnet => std::option::Option::Some("VPC_SECONDARY_SUBNET"),
Self::DynamicRoute => std::option::Option::Some("DYNAMIC_ROUTE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RouteType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RouteType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RouteType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::VpcPrimarySubnet,
2 => Self::VpcSecondarySubnet,
3 => Self::DynamicRoute,
_ => Self::UnknownValue(route_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RouteType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
"VPC_PRIMARY_SUBNET" => Self::VpcPrimarySubnet,
"VPC_SECONDARY_SUBNET" => Self::VpcSecondarySubnet,
"DYNAMIC_ROUTE" => Self::DynamicRoute,
_ => Self::UnknownValue(route_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RouteType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::VpcPrimarySubnet => serializer.serialize_i32(1),
Self::VpcSecondarySubnet => serializer.serialize_i32(2),
Self::DynamicRoute => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RouteType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
".google.cloud.networkconnectivity.v1.RouteType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Creating,
Active,
Deleting,
Accepting,
Rejecting,
Updating,
Inactive,
Obsolete,
Failed,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Creating => std::option::Option::Some(1),
Self::Active => std::option::Option::Some(2),
Self::Deleting => std::option::Option::Some(3),
Self::Accepting => std::option::Option::Some(8),
Self::Rejecting => std::option::Option::Some(9),
Self::Updating => std::option::Option::Some(6),
Self::Inactive => std::option::Option::Some(7),
Self::Obsolete => std::option::Option::Some(10),
Self::Failed => std::option::Option::Some(11),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Deleting => std::option::Option::Some("DELETING"),
Self::Accepting => std::option::Option::Some("ACCEPTING"),
Self::Rejecting => std::option::Option::Some("REJECTING"),
Self::Updating => std::option::Option::Some("UPDATING"),
Self::Inactive => std::option::Option::Some("INACTIVE"),
Self::Obsolete => std::option::Option::Some("OBSOLETE"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Creating,
2 => Self::Active,
3 => Self::Deleting,
6 => Self::Updating,
7 => Self::Inactive,
8 => Self::Accepting,
9 => Self::Rejecting,
10 => Self::Obsolete,
11 => Self::Failed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"CREATING" => Self::Creating,
"ACTIVE" => Self::Active,
"DELETING" => Self::Deleting,
"ACCEPTING" => Self::Accepting,
"REJECTING" => Self::Rejecting,
"UPDATING" => Self::Updating,
"INACTIVE" => Self::Inactive,
"OBSOLETE" => Self::Obsolete,
"FAILED" => Self::Failed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Creating => serializer.serialize_i32(1),
Self::Active => serializer.serialize_i32(2),
Self::Deleting => serializer.serialize_i32(3),
Self::Accepting => serializer.serialize_i32(8),
Self::Rejecting => serializer.serialize_i32(9),
Self::Updating => serializer.serialize_i32(6),
Self::Inactive => serializer.serialize_i32(7),
Self::Obsolete => serializer.serialize_i32(10),
Self::Failed => serializer.serialize_i32(11),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.networkconnectivity.v1.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SpokeType {
Unspecified,
VpnTunnel,
InterconnectAttachment,
RouterAppliance,
VpcNetwork,
ProducerVpcNetwork,
UnknownValue(spoke_type::UnknownValue),
}
#[doc(hidden)]
pub mod spoke_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SpokeType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::VpnTunnel => std::option::Option::Some(1),
Self::InterconnectAttachment => std::option::Option::Some(2),
Self::RouterAppliance => std::option::Option::Some(3),
Self::VpcNetwork => std::option::Option::Some(4),
Self::ProducerVpcNetwork => std::option::Option::Some(7),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SPOKE_TYPE_UNSPECIFIED"),
Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
Self::InterconnectAttachment => std::option::Option::Some("INTERCONNECT_ATTACHMENT"),
Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
Self::VpcNetwork => std::option::Option::Some("VPC_NETWORK"),
Self::ProducerVpcNetwork => std::option::Option::Some("PRODUCER_VPC_NETWORK"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SpokeType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SpokeType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SpokeType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::VpnTunnel,
2 => Self::InterconnectAttachment,
3 => Self::RouterAppliance,
4 => Self::VpcNetwork,
7 => Self::ProducerVpcNetwork,
_ => Self::UnknownValue(spoke_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SpokeType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SPOKE_TYPE_UNSPECIFIED" => Self::Unspecified,
"VPN_TUNNEL" => Self::VpnTunnel,
"INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
"ROUTER_APPLIANCE" => Self::RouterAppliance,
"VPC_NETWORK" => Self::VpcNetwork,
"PRODUCER_VPC_NETWORK" => Self::ProducerVpcNetwork,
_ => Self::UnknownValue(spoke_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SpokeType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::VpnTunnel => serializer.serialize_i32(1),
Self::InterconnectAttachment => serializer.serialize_i32(2),
Self::RouterAppliance => serializer.serialize_i32(3),
Self::VpcNetwork => serializer.serialize_i32(4),
Self::ProducerVpcNetwork => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SpokeType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeType>::new(
".google.cloud.networkconnectivity.v1.SpokeType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PolicyMode {
Unspecified,
Preset,
UnknownValue(policy_mode::UnknownValue),
}
#[doc(hidden)]
pub mod policy_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PolicyMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Preset => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("POLICY_MODE_UNSPECIFIED"),
Self::Preset => std::option::Option::Some("PRESET"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PolicyMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PolicyMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PolicyMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Preset,
_ => Self::UnknownValue(policy_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PolicyMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"POLICY_MODE_UNSPECIFIED" => Self::Unspecified,
"PRESET" => Self::Preset,
_ => Self::UnknownValue(policy_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PolicyMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Preset => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PolicyMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyMode>::new(
".google.cloud.networkconnectivity.v1.PolicyMode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PresetTopology {
Unspecified,
Mesh,
Star,
UnknownValue(preset_topology::UnknownValue),
}
#[doc(hidden)]
pub mod preset_topology {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PresetTopology {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Mesh => std::option::Option::Some(2),
Self::Star => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PRESET_TOPOLOGY_UNSPECIFIED"),
Self::Mesh => std::option::Option::Some("MESH"),
Self::Star => std::option::Option::Some("STAR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PresetTopology {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PresetTopology {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PresetTopology {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
2 => Self::Mesh,
3 => Self::Star,
_ => Self::UnknownValue(preset_topology::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PresetTopology {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PRESET_TOPOLOGY_UNSPECIFIED" => Self::Unspecified,
"MESH" => Self::Mesh,
"STAR" => Self::Star,
_ => Self::UnknownValue(preset_topology::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PresetTopology {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Mesh => serializer.serialize_i32(2),
Self::Star => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PresetTopology {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PresetTopology>::new(
".google.cloud.networkconnectivity.v1.PresetTopology",
))
}
}