#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct AuthorizeTargetsRequest {
#[serde(
rename = "targets",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_map",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub targets: ::buffa::alloc::collections::BTreeMap<
::buffa::alloc::string::String,
AuthSegments,
>,
}
impl ::core::fmt::Debug for AuthorizeTargetsRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AuthorizeTargetsRequest")
.field("targets", &self.targets)
.finish()
}
}
impl AuthorizeTargetsRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/anapaya.wap.v1.AuthorizeTargetsRequest";
}
::buffa::impl_default_instance!(AuthorizeTargetsRequest);
impl ::buffa::MessageName for AuthorizeTargetsRequest {
const PACKAGE: &'static str = "anapaya.wap.v1";
const NAME: &'static str = "AuthorizeTargetsRequest";
const FULL_NAME: &'static str = "anapaya.wap.v1.AuthorizeTargetsRequest";
const TYPE_URL: &'static str = "type.googleapis.com/anapaya.wap.v1.AuthorizeTargetsRequest";
}
impl ::buffa::Message for AuthorizeTargetsRequest {
#[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;
size
+= ::buffa::map_codec::message_field_len::<
::buffa::map_codec::Str,
_,
_,
>(&self.targets, 1u32, __cache);
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
::buffa::map_codec::write_message_field::<
::buffa::map_codec::Str,
_,
_,
>(&self.targets, 1u32, __cache, 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::map_codec::merge_entry::<
::buffa::map_codec::Str,
::buffa::map_codec::Msg<_>,
_,
>(&mut self.targets, buf, ctx)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
::buffa::map_codec::MapStorage::storage_clear(&mut self.targets);
}
}
impl ::buffa::json_helpers::ProtoElemJson for AuthorizeTargetsRequest {
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 __AUTHORIZE_TARGETS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/anapaya.wap.v1.AuthorizeTargetsRequest",
to_json: ::buffa::type_registry::any_to_json::<AuthorizeTargetsRequest>,
from_json: ::buffa::type_registry::any_from_json::<AuthorizeTargetsRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct AuthSegments {
#[serde(
rename = "upSegments",
alias = "up_segments",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub up_segments: ::buffa::alloc::vec::Vec<
::scion_protobuf::proto::control_plane::v1::PathSegment,
>,
#[serde(
rename = "downSegments",
alias = "down_segments",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub down_segments: ::buffa::alloc::vec::Vec<
::scion_protobuf::proto::control_plane::v1::PathSegment,
>,
#[serde(
rename = "coreSegments",
alias = "core_segments",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub core_segments: ::buffa::alloc::vec::Vec<
::scion_protobuf::proto::control_plane::v1::PathSegment,
>,
}
impl ::core::fmt::Debug for AuthSegments {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AuthSegments")
.field("up_segments", &self.up_segments)
.field("down_segments", &self.down_segments)
.field("core_segments", &self.core_segments)
.finish()
}
}
impl AuthSegments {
pub const TYPE_URL: &'static str = "type.googleapis.com/anapaya.wap.v1.AuthSegments";
}
::buffa::impl_default_instance!(AuthSegments);
impl ::buffa::MessageName for AuthSegments {
const PACKAGE: &'static str = "anapaya.wap.v1";
const NAME: &'static str = "AuthSegments";
const FULL_NAME: &'static str = "anapaya.wap.v1.AuthSegments";
const TYPE_URL: &'static str = "type.googleapis.com/anapaya.wap.v1.AuthSegments";
}
impl ::buffa::Message for AuthSegments {
#[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;
for v in &self.up_segments {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.down_segments {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
for v in &self.core_segments {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.up_segments {
::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
v.write_to(__cache, buf);
}
for v in &self.down_segments {
::buffa::types::put_len_delimited_header(2u32, __cache.consume_next(), buf);
v.write_to(__cache, buf);
}
for v in &self.core_segments {
::buffa::types::put_len_delimited_header(3u32, __cache.consume_next(), buf);
v.write_to(__cache, 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,
)?;
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.up_segments.push(elem);
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.down_segments.push(elem);
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, ctx)?;
self.core_segments.push(elem);
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.up_segments.clear();
self.down_segments.clear();
self.core_segments.clear();
}
}
impl ::buffa::json_helpers::ProtoElemJson for AuthSegments {
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 __AUTH_SEGMENTS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/anapaya.wap.v1.AuthSegments",
to_json: ::buffa::type_registry::any_to_json::<AuthSegments>,
from_json: ::buffa::type_registry::any_from_json::<AuthSegments>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct AuthorizeTargetsResponse {
#[serde(
rename = "clientIp",
alias = "client_ip",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub client_ip: ::buffa::alloc::string::String,
#[serde(
rename = "wapId",
alias = "wap_id",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub wap_id: ::buffa::alloc::string::String,
#[serde(
rename = "dataPlanePort",
alias = "data_plane_port",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub data_plane_port: u32,
#[serde(
rename = "expiryTime",
alias = "expiry_time",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)]
pub expiry_time: u64,
}
impl ::core::fmt::Debug for AuthorizeTargetsResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("AuthorizeTargetsResponse")
.field("client_ip", &self.client_ip)
.field("wap_id", &self.wap_id)
.field("data_plane_port", &self.data_plane_port)
.field("expiry_time", &self.expiry_time)
.finish()
}
}
impl AuthorizeTargetsResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/anapaya.wap.v1.AuthorizeTargetsResponse";
}
::buffa::impl_default_instance!(AuthorizeTargetsResponse);
impl ::buffa::MessageName for AuthorizeTargetsResponse {
const PACKAGE: &'static str = "anapaya.wap.v1";
const NAME: &'static str = "AuthorizeTargetsResponse";
const FULL_NAME: &'static str = "anapaya.wap.v1.AuthorizeTargetsResponse";
const TYPE_URL: &'static str = "type.googleapis.com/anapaya.wap.v1.AuthorizeTargetsResponse";
}
impl ::buffa::Message for AuthorizeTargetsResponse {
#[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.client_ip.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.client_ip) as u32;
}
if !self.wap_id.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.wap_id) as u32;
}
if self.data_plane_port != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.data_plane_port) as u32;
}
if self.expiry_time != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.expiry_time) 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.client_ip.is_empty() {
::buffa::types::put_string_field(1u32, &self.client_ip, buf);
}
if !self.wap_id.is_empty() {
::buffa::types::put_string_field(2u32, &self.wap_id, buf);
}
if self.data_plane_port != 0u32 {
::buffa::types::put_uint32_field(3u32, self.data_plane_port, buf);
}
if self.expiry_time != 0u64 {
::buffa::types::put_uint64_field(4u32, self.expiry_time, 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.client_ip, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.wap_id, buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.data_plane_port = ::buffa::types::decode_uint32(buf)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.expiry_time = ::buffa::types::decode_uint64(buf)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, buf, ctx.depth())?;
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.client_ip.clear();
self.wap_id.clear();
self.data_plane_port = 0u32;
self.expiry_time = 0u64;
}
}
impl ::buffa::json_helpers::ProtoElemJson for AuthorizeTargetsResponse {
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 __AUTHORIZE_TARGETS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/anapaya.wap.v1.AuthorizeTargetsResponse",
to_json: ::buffa::type_registry::any_to_json::<AuthorizeTargetsResponse>,
from_json: ::buffa::type_registry::any_from_json::<AuthorizeTargetsResponse>,
is_wkt: false,
};