#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct GetSnapDataPlaneAddressRequest {}
impl ::core::fmt::Debug for GetSnapDataPlaneAddressRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetSnapDataPlaneAddressRequest").finish()
}
}
impl GetSnapDataPlaneAddressRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/anapaya.snap.v1.GetSnapDataPlaneAddressRequest";
}
::buffa::impl_default_instance!(GetSnapDataPlaneAddressRequest);
impl ::buffa::MessageName for GetSnapDataPlaneAddressRequest {
const PACKAGE: &'static str = "anapaya.snap.v1";
const NAME: &'static str = "GetSnapDataPlaneAddressRequest";
const FULL_NAME: &'static str = "anapaya.snap.v1.GetSnapDataPlaneAddressRequest";
const TYPE_URL: &'static str = "type.googleapis.com/anapaya.snap.v1.GetSnapDataPlaneAddressRequest";
}
impl ::buffa::Message for GetSnapDataPlaneAddressRequest {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let size = 0u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
_buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {}
}
impl ::buffa::json_helpers::ProtoElemJson for GetSnapDataPlaneAddressRequest {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __GET_SNAP_DATA_PLANE_ADDRESS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/anapaya.snap.v1.GetSnapDataPlaneAddressRequest",
to_json: ::buffa::type_registry::any_to_json::<GetSnapDataPlaneAddressRequest>,
from_json: ::buffa::type_registry::any_from_json::<GetSnapDataPlaneAddressRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct GetSnapDataPlaneAddressResponse {
#[serde(
rename = "address",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub address: ::buffa::alloc::string::String,
#[serde(
rename = "snapTunControlAddress",
alias = "snap_tun_control_address",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub snap_tun_control_address: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(
rename = "snapStaticX25519",
alias = "snap_static_x25519",
with = "::buffa::json_helpers::opt_bytes",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub snap_static_x25519: ::core::option::Option<::buffa::alloc::vec::Vec<u8>>,
}
impl ::core::fmt::Debug for GetSnapDataPlaneAddressResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetSnapDataPlaneAddressResponse")
.field("address", &self.address)
.field("snap_tun_control_address", &self.snap_tun_control_address)
.field("snap_static_x25519", &self.snap_static_x25519)
.finish()
}
}
impl GetSnapDataPlaneAddressResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/anapaya.snap.v1.GetSnapDataPlaneAddressResponse";
}
impl GetSnapDataPlaneAddressResponse {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_snap_tun_control_address(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.snap_tun_control_address = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_snap_static_x25519(
mut self,
value: impl Into<::buffa::alloc::vec::Vec<u8>>,
) -> Self {
self.snap_static_x25519 = Some(value.into());
self
}
}
::buffa::impl_default_instance!(GetSnapDataPlaneAddressResponse);
impl ::buffa::MessageName for GetSnapDataPlaneAddressResponse {
const PACKAGE: &'static str = "anapaya.snap.v1";
const NAME: &'static str = "GetSnapDataPlaneAddressResponse";
const FULL_NAME: &'static str = "anapaya.snap.v1.GetSnapDataPlaneAddressResponse";
const TYPE_URL: &'static str = "type.googleapis.com/anapaya.snap.v1.GetSnapDataPlaneAddressResponse";
}
impl ::buffa::Message for GetSnapDataPlaneAddressResponse {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.address.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.address) as u32;
}
if let Some(ref v) = self.snap_tun_control_address {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.snap_static_x25519 {
size += 1u32 + ::buffa::types::bytes_encoded_len(v) as u32;
}
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.address.is_empty() {
::buffa::types::put_string_field(1u32, &self.address, buf);
}
if let Some(ref v) = self.snap_tun_control_address {
::buffa::types::put_string_field(2u32, v, buf);
}
if let Some(ref v) = self.snap_static_x25519 {
::buffa::types::put_bytes_field(3u32, v, buf);
}
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.address, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(
self
.snap_tun_control_address
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(
self
.snap_static_x25519
.get_or_insert_with(::buffa::alloc::vec::Vec::new),
buf,
)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.address.clear();
self.snap_tun_control_address = ::core::option::Option::None;
self.snap_static_x25519 = ::core::option::Option::None;
}
}
impl ::buffa::json_helpers::ProtoElemJson for GetSnapDataPlaneAddressResponse {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __GET_SNAP_DATA_PLANE_ADDRESS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/anapaya.snap.v1.GetSnapDataPlaneAddressResponse",
to_json: ::buffa::type_registry::any_to_json::<GetSnapDataPlaneAddressResponse>,
from_json: ::buffa::type_registry::any_from_json::<GetSnapDataPlaneAddressResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct RegisterSnapTunIdentityRequest {
#[serde(
rename = "initiatorStaticX25519",
alias = "initiator_static_x25519",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)]
pub initiator_static_x25519: ::buffa::alloc::vec::Vec<u8>,
#[serde(
rename = "pskShare",
alias = "psk_share",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)]
pub psk_share: ::buffa::alloc::vec::Vec<u8>,
}
impl ::core::fmt::Debug for RegisterSnapTunIdentityRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("RegisterSnapTunIdentityRequest")
.field("initiator_static_x25519", &self.initiator_static_x25519)
.field("psk_share", &self.psk_share)
.finish()
}
}
impl RegisterSnapTunIdentityRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/anapaya.snap.v1.RegisterSnapTunIdentityRequest";
}
::buffa::impl_default_instance!(RegisterSnapTunIdentityRequest);
impl ::buffa::MessageName for RegisterSnapTunIdentityRequest {
const PACKAGE: &'static str = "anapaya.snap.v1";
const NAME: &'static str = "RegisterSnapTunIdentityRequest";
const FULL_NAME: &'static str = "anapaya.snap.v1.RegisterSnapTunIdentityRequest";
const TYPE_URL: &'static str = "type.googleapis.com/anapaya.snap.v1.RegisterSnapTunIdentityRequest";
}
impl ::buffa::Message for RegisterSnapTunIdentityRequest {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.initiator_static_x25519.is_empty() {
size
+= 1u32
+ ::buffa::types::bytes_encoded_len(&self.initiator_static_x25519)
as u32;
}
if !self.psk_share.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.psk_share) as u32;
}
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.initiator_static_x25519.is_empty() {
::buffa::types::put_bytes_field(1u32, &self.initiator_static_x25519, buf);
}
if !self.psk_share.is_empty() {
::buffa::types::put_bytes_field(2u32, &self.psk_share, buf);
}
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(&mut self.initiator_static_x25519, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(&mut self.psk_share, buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.initiator_static_x25519.clear();
self.psk_share.clear();
}
}
impl ::buffa::json_helpers::ProtoElemJson for RegisterSnapTunIdentityRequest {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __REGISTER_SNAP_TUN_IDENTITY_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/anapaya.snap.v1.RegisterSnapTunIdentityRequest",
to_json: ::buffa::type_registry::any_to_json::<RegisterSnapTunIdentityRequest>,
from_json: ::buffa::type_registry::any_from_json::<RegisterSnapTunIdentityRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct RegisterSnapTunIdentityResponse {
#[serde(
rename = "pskShare",
alias = "psk_share",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)]
pub psk_share: ::buffa::alloc::vec::Vec<u8>,
}
impl ::core::fmt::Debug for RegisterSnapTunIdentityResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("RegisterSnapTunIdentityResponse")
.field("psk_share", &self.psk_share)
.finish()
}
}
impl RegisterSnapTunIdentityResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/anapaya.snap.v1.RegisterSnapTunIdentityResponse";
}
::buffa::impl_default_instance!(RegisterSnapTunIdentityResponse);
impl ::buffa::MessageName for RegisterSnapTunIdentityResponse {
const PACKAGE: &'static str = "anapaya.snap.v1";
const NAME: &'static str = "RegisterSnapTunIdentityResponse";
const FULL_NAME: &'static str = "anapaya.snap.v1.RegisterSnapTunIdentityResponse";
const TYPE_URL: &'static str = "type.googleapis.com/anapaya.snap.v1.RegisterSnapTunIdentityResponse";
}
impl ::buffa::Message for RegisterSnapTunIdentityResponse {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.psk_share.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.psk_share) as u32;
}
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.psk_share.is_empty() {
::buffa::types::put_bytes_field(1u32, &self.psk_share, buf);
}
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(&mut self.psk_share, buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.psk_share.clear();
}
}
impl ::buffa::json_helpers::ProtoElemJson for RegisterSnapTunIdentityResponse {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __REGISTER_SNAP_TUN_IDENTITY_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/anapaya.snap.v1.RegisterSnapTunIdentityResponse",
to_json: ::buffa::type_registry::any_to_json::<RegisterSnapTunIdentityResponse>,
from_json: ::buffa::type_registry::any_from_json::<RegisterSnapTunIdentityResponse>,
is_wkt: false,
};