#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[repr(i32)]
pub enum ProtectedAction {
PROTECTED_ACTION_UNSPECIFIED = 0i32,
PROTECTED_ACTION_FUNDING_SET_EXTERNAL_WHITELIST_REQUIRED = 1i32,
PROTECTED_ACTION_FUNDING_ADD_EXTERNAL_WHITELIST = 2i32,
PROTECTED_ACTION_FUNDING_REMOVE_EXTERNAL_WHITELIST = 3i32,
PROTECTED_ACTION_FUNDING_ADD_INTERNAL_WHITELIST = 4i32,
PROTECTED_ACTION_FUNDING_REMOVE_INTERNAL_WHITELIST = 5i32,
PROTECTED_ACTION_FUNDING_SET_INTERNAL_WHITELIST_REQUIRED = 6i32,
}
impl ProtectedAction {
#[allow(non_upper_case_globals)]
pub const Unspecified: Self = Self::PROTECTED_ACTION_UNSPECIFIED;
#[allow(non_upper_case_globals)]
pub const FundingSetExternalWhitelistRequired: Self = Self::PROTECTED_ACTION_FUNDING_SET_EXTERNAL_WHITELIST_REQUIRED;
#[allow(non_upper_case_globals)]
pub const FundingAddExternalWhitelist: Self = Self::PROTECTED_ACTION_FUNDING_ADD_EXTERNAL_WHITELIST;
#[allow(non_upper_case_globals)]
pub const FundingRemoveExternalWhitelist: Self = Self::PROTECTED_ACTION_FUNDING_REMOVE_EXTERNAL_WHITELIST;
#[allow(non_upper_case_globals)]
pub const FundingAddInternalWhitelist: Self = Self::PROTECTED_ACTION_FUNDING_ADD_INTERNAL_WHITELIST;
#[allow(non_upper_case_globals)]
pub const FundingRemoveInternalWhitelist: Self = Self::PROTECTED_ACTION_FUNDING_REMOVE_INTERNAL_WHITELIST;
#[allow(non_upper_case_globals)]
pub const FundingSetInternalWhitelistRequired: Self = Self::PROTECTED_ACTION_FUNDING_SET_INTERNAL_WHITELIST_REQUIRED;
}
impl ::core::default::Default for ProtectedAction {
fn default() -> Self {
Self::PROTECTED_ACTION_UNSPECIFIED
}
}
impl ::serde::Serialize for ProtectedAction {
fn serialize<S: ::serde::Serializer>(
&self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
s.serialize_str(::buffa::Enumeration::proto_name(self))
}
}
impl<'de> ::serde::Deserialize<'de> for ProtectedAction {
fn deserialize<D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl ::serde::de::Visitor<'_> for _V {
type Value = ProtectedAction;
fn expecting(
&self,
f: &mut ::core::fmt::Formatter<'_>,
) -> ::core::fmt::Result {
f.write_str(
concat!(
"a string, integer, or null for ", stringify!(ProtectedAction)
),
)
}
fn visit_str<E: ::serde::de::Error>(
self,
v: &str,
) -> ::core::result::Result<ProtectedAction, E> {
<ProtectedAction as ::buffa::Enumeration>::from_proto_name(v)
.ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
}
fn visit_i64<E: ::serde::de::Error>(
self,
v: i64,
) -> ::core::result::Result<ProtectedAction, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<ProtectedAction as ::buffa::Enumeration>::from_i32(v32)
.ok_or_else(|| {
::serde::de::Error::custom(
::buffa::alloc::format!("unknown enum value {v32}"),
)
})
}
fn visit_u64<E: ::serde::de::Error>(
self,
v: u64,
) -> ::core::result::Result<ProtectedAction, E> {
let v32 = i32::try_from(v)
.map_err(|_| {
::serde::de::Error::custom(
::buffa::alloc::format!("enum value {v} out of i32 range"),
)
})?;
<ProtectedAction as ::buffa::Enumeration>::from_i32(v32)
.ok_or_else(|| {
::serde::de::Error::custom(
::buffa::alloc::format!("unknown enum value {v32}"),
)
})
}
fn visit_unit<E: ::serde::de::Error>(
self,
) -> ::core::result::Result<ProtectedAction, E> {
::core::result::Result::Ok(::core::default::Default::default())
}
}
d.deserialize_any(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for ProtectedAction {
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)
}
}
impl ::buffa::Enumeration for ProtectedAction {
fn from_i32(value: i32) -> ::core::option::Option<Self> {
match value {
0i32 => ::core::option::Option::Some(Self::PROTECTED_ACTION_UNSPECIFIED),
1i32 => {
::core::option::Option::Some(
Self::PROTECTED_ACTION_FUNDING_SET_EXTERNAL_WHITELIST_REQUIRED,
)
}
2i32 => {
::core::option::Option::Some(
Self::PROTECTED_ACTION_FUNDING_ADD_EXTERNAL_WHITELIST,
)
}
3i32 => {
::core::option::Option::Some(
Self::PROTECTED_ACTION_FUNDING_REMOVE_EXTERNAL_WHITELIST,
)
}
4i32 => {
::core::option::Option::Some(
Self::PROTECTED_ACTION_FUNDING_ADD_INTERNAL_WHITELIST,
)
}
5i32 => {
::core::option::Option::Some(
Self::PROTECTED_ACTION_FUNDING_REMOVE_INTERNAL_WHITELIST,
)
}
6i32 => {
::core::option::Option::Some(
Self::PROTECTED_ACTION_FUNDING_SET_INTERNAL_WHITELIST_REQUIRED,
)
}
_ => ::core::option::Option::None,
}
}
fn to_i32(&self) -> i32 {
*self as i32
}
fn proto_name(&self) -> &'static str {
match self {
Self::PROTECTED_ACTION_UNSPECIFIED => "PROTECTED_ACTION_UNSPECIFIED",
Self::PROTECTED_ACTION_FUNDING_SET_EXTERNAL_WHITELIST_REQUIRED => {
"PROTECTED_ACTION_FUNDING_SET_EXTERNAL_WHITELIST_REQUIRED"
}
Self::PROTECTED_ACTION_FUNDING_ADD_EXTERNAL_WHITELIST => {
"PROTECTED_ACTION_FUNDING_ADD_EXTERNAL_WHITELIST"
}
Self::PROTECTED_ACTION_FUNDING_REMOVE_EXTERNAL_WHITELIST => {
"PROTECTED_ACTION_FUNDING_REMOVE_EXTERNAL_WHITELIST"
}
Self::PROTECTED_ACTION_FUNDING_ADD_INTERNAL_WHITELIST => {
"PROTECTED_ACTION_FUNDING_ADD_INTERNAL_WHITELIST"
}
Self::PROTECTED_ACTION_FUNDING_REMOVE_INTERNAL_WHITELIST => {
"PROTECTED_ACTION_FUNDING_REMOVE_INTERNAL_WHITELIST"
}
Self::PROTECTED_ACTION_FUNDING_SET_INTERNAL_WHITELIST_REQUIRED => {
"PROTECTED_ACTION_FUNDING_SET_INTERNAL_WHITELIST_REQUIRED"
}
}
}
fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
match name {
"PROTECTED_ACTION_UNSPECIFIED" => {
::core::option::Option::Some(Self::PROTECTED_ACTION_UNSPECIFIED)
}
"PROTECTED_ACTION_FUNDING_SET_EXTERNAL_WHITELIST_REQUIRED" => {
::core::option::Option::Some(
Self::PROTECTED_ACTION_FUNDING_SET_EXTERNAL_WHITELIST_REQUIRED,
)
}
"PROTECTED_ACTION_FUNDING_ADD_EXTERNAL_WHITELIST" => {
::core::option::Option::Some(
Self::PROTECTED_ACTION_FUNDING_ADD_EXTERNAL_WHITELIST,
)
}
"PROTECTED_ACTION_FUNDING_REMOVE_EXTERNAL_WHITELIST" => {
::core::option::Option::Some(
Self::PROTECTED_ACTION_FUNDING_REMOVE_EXTERNAL_WHITELIST,
)
}
"PROTECTED_ACTION_FUNDING_ADD_INTERNAL_WHITELIST" => {
::core::option::Option::Some(
Self::PROTECTED_ACTION_FUNDING_ADD_INTERNAL_WHITELIST,
)
}
"PROTECTED_ACTION_FUNDING_REMOVE_INTERNAL_WHITELIST" => {
::core::option::Option::Some(
Self::PROTECTED_ACTION_FUNDING_REMOVE_INTERNAL_WHITELIST,
)
}
"PROTECTED_ACTION_FUNDING_SET_INTERNAL_WHITELIST_REQUIRED" => {
::core::option::Option::Some(
Self::PROTECTED_ACTION_FUNDING_SET_INTERNAL_WHITELIST_REQUIRED,
)
}
_ => ::core::option::Option::None,
}
}
fn values() -> &'static [Self] {
&[
Self::PROTECTED_ACTION_UNSPECIFIED,
Self::PROTECTED_ACTION_FUNDING_SET_EXTERNAL_WHITELIST_REQUIRED,
Self::PROTECTED_ACTION_FUNDING_ADD_EXTERNAL_WHITELIST,
Self::PROTECTED_ACTION_FUNDING_REMOVE_EXTERNAL_WHITELIST,
Self::PROTECTED_ACTION_FUNDING_ADD_INTERNAL_WHITELIST,
Self::PROTECTED_ACTION_FUNDING_REMOVE_INTERNAL_WHITELIST,
Self::PROTECTED_ACTION_FUNDING_SET_INTERNAL_WHITELIST_REQUIRED,
]
}
}
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct GuardSignerStatus {
#[serde(
rename = "signerAddress",
alias = "signer_address",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub signer_address: ::buffa::alloc::string::String,
#[serde(
rename = "onchainSignerAddress",
alias = "onchain_signer_address",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub onchain_signer_address: ::buffa::alloc::string::String,
#[serde(
rename = "initialized",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)]
pub initialized: bool,
#[serde(
rename = "nonce",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub nonce: ::buffa::alloc::string::String,
#[serde(
rename = "nonceSpace",
alias = "nonce_space",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)]
pub nonce_space: u64,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GuardSignerStatus {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GuardSignerStatus")
.field("signer_address", &self.signer_address)
.field("onchain_signer_address", &self.onchain_signer_address)
.field("initialized", &self.initialized)
.field("nonce", &self.nonce)
.field("nonce_space", &self.nonce_space)
.finish()
}
}
impl GuardSignerStatus {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.GuardSignerStatus";
}
::buffa::impl_default_instance!(GuardSignerStatus);
impl ::buffa::MessageName for GuardSignerStatus {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "GuardSignerStatus";
const FULL_NAME: &'static str = "chain.guard.v1.GuardSignerStatus";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.GuardSignerStatus";
}
impl ::buffa::Message for GuardSignerStatus {
#[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.signer_address.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.signer_address) as u32;
}
if !self.onchain_signer_address.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.onchain_signer_address)
as u32;
}
if self.initialized {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if !self.nonce.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.nonce) as u32;
}
if self.nonce_space != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.nonce_space) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() 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.signer_address.is_empty() {
::buffa::types::put_string_field(1u32, &self.signer_address, buf);
}
if !self.onchain_signer_address.is_empty() {
::buffa::types::put_string_field(2u32, &self.onchain_signer_address, buf);
}
if self.initialized {
::buffa::types::put_bool_field(3u32, self.initialized, buf);
}
if !self.nonce.is_empty() {
::buffa::types::put_string_field(4u32, &self.nonce, buf);
}
if self.nonce_space != 0u64 {
::buffa::types::put_uint64_field(5u32, self.nonce_space, buf);
}
self.__buffa_unknown_fields.write_to(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.signer_address, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.onchain_signer_address, buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.initialized = ::buffa::types::decode_bool(buf)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_string(&mut self.nonce, buf)?;
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.nonce_space = ::buffa::types::decode_uint64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.signer_address.clear();
self.onchain_signer_address.clear();
self.initialized = false;
self.nonce.clear();
self.nonce_space = 0u64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GuardSignerStatus {
const PROTO_FQN: &'static str = "chain.guard.v1.GuardSignerStatus";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for GuardSignerStatus {
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 __GUARD_SIGNER_STATUS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.GuardSignerStatus",
to_json: ::buffa::type_registry::any_to_json::<GuardSignerStatus>,
from_json: ::buffa::type_registry::any_from_json::<GuardSignerStatus>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct GuardApproval {
#[serde(
rename = "nonceSpace",
alias = "nonce_space",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)]
pub nonce_space: u64,
#[serde(
rename = "deadlineUnix",
alias = "deadline_unix",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)]
pub deadline_unix: u64,
#[serde(
rename = "signature",
with = "::buffa::json_helpers::bytes",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_bytes"
)]
pub signature: ::buffa::alloc::vec::Vec<u8>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GuardApproval {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GuardApproval")
.field("nonce_space", &self.nonce_space)
.field("deadline_unix", &self.deadline_unix)
.field("signature", &self.signature)
.finish()
}
}
impl GuardApproval {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.GuardApproval";
}
::buffa::impl_default_instance!(GuardApproval);
impl ::buffa::MessageName for GuardApproval {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "GuardApproval";
const FULL_NAME: &'static str = "chain.guard.v1.GuardApproval";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.GuardApproval";
}
impl ::buffa::Message for GuardApproval {
#[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.nonce_space != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.nonce_space) as u32;
}
if self.deadline_unix != 0u64 {
size += 1u32 + ::buffa::types::uint64_encoded_len(self.deadline_unix) as u32;
}
if !self.signature.is_empty() {
size += 1u32 + ::buffa::types::bytes_encoded_len(&self.signature) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() 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.nonce_space != 0u64 {
::buffa::types::put_uint64_field(1u32, self.nonce_space, buf);
}
if self.deadline_unix != 0u64 {
::buffa::types::put_uint64_field(2u32, self.deadline_unix, buf);
}
if !self.signature.is_empty() {
::buffa::types::put_bytes_field(3u32, &self.signature, buf);
}
self.__buffa_unknown_fields.write_to(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::Varint,
)?;
self.nonce_space = ::buffa::types::decode_uint64(buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.deadline_unix = ::buffa::types::decode_uint64(buf)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::types::merge_bytes(&mut self.signature, buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.nonce_space = 0u64;
self.deadline_unix = 0u64;
self.signature.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GuardApproval {
const PROTO_FQN: &'static str = "chain.guard.v1.GuardApproval";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for GuardApproval {
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 __GUARD_APPROVAL_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.GuardApproval",
to_json: ::buffa::type_registry::any_to_json::<GuardApproval>,
from_json: ::buffa::type_registry::any_from_json::<GuardApproval>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct ExternalWhitelistArgs {
#[serde(
rename = "polychainChainId",
alias = "polychain_chain_id",
with = "::buffa::json_helpers::uint32",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u32"
)]
pub polychain_chain_id: u32,
#[serde(
rename = "addresses",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub addresses: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ExternalWhitelistArgs {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ExternalWhitelistArgs")
.field("polychain_chain_id", &self.polychain_chain_id)
.field("addresses", &self.addresses)
.finish()
}
}
impl ExternalWhitelistArgs {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.ExternalWhitelistArgs";
}
::buffa::impl_default_instance!(ExternalWhitelistArgs);
impl ::buffa::MessageName for ExternalWhitelistArgs {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "ExternalWhitelistArgs";
const FULL_NAME: &'static str = "chain.guard.v1.ExternalWhitelistArgs";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.ExternalWhitelistArgs";
}
impl ::buffa::Message for ExternalWhitelistArgs {
#[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.polychain_chain_id != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.polychain_chain_id) as u32;
}
for v in &self.addresses {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() 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.polychain_chain_id != 0u32 {
::buffa::types::put_uint32_field(1u32, self.polychain_chain_id, buf);
}
for v in &self.addresses {
::buffa::types::put_string_field(2u32, v, buf);
}
self.__buffa_unknown_fields.write_to(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::Varint,
)?;
self.polychain_chain_id = ::buffa::types::decode_uint32(buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
self.addresses.push(::buffa::types::decode_string(buf)?);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.polychain_chain_id = 0u32;
self.addresses.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ExternalWhitelistArgs {
const PROTO_FQN: &'static str = "chain.guard.v1.ExternalWhitelistArgs";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for ExternalWhitelistArgs {
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 __EXTERNAL_WHITELIST_ARGS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.ExternalWhitelistArgs",
to_json: ::buffa::type_registry::any_to_json::<ExternalWhitelistArgs>,
from_json: ::buffa::type_registry::any_from_json::<ExternalWhitelistArgs>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct InternalWhitelistArgs {
#[serde(
rename = "addresses",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub addresses: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for InternalWhitelistArgs {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("InternalWhitelistArgs")
.field("addresses", &self.addresses)
.finish()
}
}
impl InternalWhitelistArgs {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.InternalWhitelistArgs";
}
::buffa::impl_default_instance!(InternalWhitelistArgs);
impl ::buffa::MessageName for InternalWhitelistArgs {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "InternalWhitelistArgs";
const FULL_NAME: &'static str = "chain.guard.v1.InternalWhitelistArgs";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.InternalWhitelistArgs";
}
impl ::buffa::Message for InternalWhitelistArgs {
#[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.addresses {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
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.addresses {
::buffa::types::put_string_field(1u32, v, buf);
}
self.__buffa_unknown_fields.write_to(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,
)?;
self.addresses.push(::buffa::types::decode_string(buf)?);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.addresses.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for InternalWhitelistArgs {
const PROTO_FQN: &'static str = "chain.guard.v1.InternalWhitelistArgs";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for InternalWhitelistArgs {
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 __INTERNAL_WHITELIST_ARGS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.InternalWhitelistArgs",
to_json: ::buffa::type_registry::any_to_json::<InternalWhitelistArgs>,
from_json: ::buffa::type_registry::any_from_json::<InternalWhitelistArgs>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct WhitelistRequirementArgs {
#[serde(
rename = "required",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)]
pub required: bool,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for WhitelistRequirementArgs {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("WhitelistRequirementArgs")
.field("required", &self.required)
.finish()
}
}
impl WhitelistRequirementArgs {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.WhitelistRequirementArgs";
}
::buffa::impl_default_instance!(WhitelistRequirementArgs);
impl ::buffa::MessageName for WhitelistRequirementArgs {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "WhitelistRequirementArgs";
const FULL_NAME: &'static str = "chain.guard.v1.WhitelistRequirementArgs";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.WhitelistRequirementArgs";
}
impl ::buffa::Message for WhitelistRequirementArgs {
#[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.required {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() 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.required {
::buffa::types::put_bool_field(1u32, self.required, buf);
}
self.__buffa_unknown_fields.write_to(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::Varint,
)?;
self.required = ::buffa::types::decode_bool(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.required = false;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for WhitelistRequirementArgs {
const PROTO_FQN: &'static str = "chain.guard.v1.WhitelistRequirementArgs";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for WhitelistRequirementArgs {
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 __WHITELIST_REQUIREMENT_ARGS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.WhitelistRequirementArgs",
to_json: ::buffa::type_registry::any_to_json::<WhitelistRequirementArgs>,
from_json: ::buffa::type_registry::any_from_json::<WhitelistRequirementArgs>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize)]
#[serde(default)]
pub struct ProtectedActionArgs {
#[serde(flatten)]
pub args: ::core::option::Option<__buffa::oneof::protected_action_args::Args>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ProtectedActionArgs {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ProtectedActionArgs").field("args", &self.args).finish()
}
}
impl ProtectedActionArgs {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.ProtectedActionArgs";
}
::buffa::impl_default_instance!(ProtectedActionArgs);
impl ::buffa::MessageName for ProtectedActionArgs {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "ProtectedActionArgs";
const FULL_NAME: &'static str = "chain.guard.v1.ProtectedActionArgs";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.ProtectedActionArgs";
}
impl ::buffa::Message for ProtectedActionArgs {
#[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 let ::core::option::Option::Some(ref v) = self.args {
match v {
__buffa::oneof::protected_action_args::Args::ExternalWhitelist(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::protected_action_args::Args::InternalWhitelist(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
__buffa::oneof::protected_action_args::Args::WhitelistRequirement(x) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
}
}
size += self.__buffa_unknown_fields.encoded_len() 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 let ::core::option::Option::Some(ref v) = self.args {
match v {
__buffa::oneof::protected_action_args::Args::ExternalWhitelist(x) => {
::buffa::types::put_len_delimited_header(
1u32,
__cache.consume_next(),
buf,
);
x.write_to(__cache, buf);
}
__buffa::oneof::protected_action_args::Args::InternalWhitelist(x) => {
::buffa::types::put_len_delimited_header(
2u32,
__cache.consume_next(),
buf,
);
x.write_to(__cache, buf);
}
__buffa::oneof::protected_action_args::Args::WhitelistRequirement(x) => {
::buffa::types::put_len_delimited_header(
3u32,
__cache.consume_next(),
buf,
);
x.write_to(__cache, buf);
}
}
}
self.__buffa_unknown_fields.write_to(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,
)?;
if let ::core::option::Option::Some(
__buffa::oneof::protected_action_args::Args::ExternalWhitelist(
ref mut existing,
),
) = self.args
{
::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.args = ::core::option::Option::Some(
__buffa::oneof::protected_action_args::Args::ExternalWhitelist(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
__buffa::oneof::protected_action_args::Args::InternalWhitelist(
ref mut existing,
),
) = self.args
{
::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.args = ::core::option::Option::Some(
__buffa::oneof::protected_action_args::Args::InternalWhitelist(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
if let ::core::option::Option::Some(
__buffa::oneof::protected_action_args::Args::WhitelistRequirement(
ref mut existing,
),
) = self.args
{
::buffa::Message::merge_length_delimited(&mut **existing, buf, ctx)?;
} else {
let mut val = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut val, buf, ctx)?;
self.args = ::core::option::Option::Some(
__buffa::oneof::protected_action_args::Args::WhitelistRequirement(
::buffa::alloc::boxed::Box::new(val),
),
);
}
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.args = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ProtectedActionArgs {
const PROTO_FQN: &'static str = "chain.guard.v1.ProtectedActionArgs";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl<'de> serde::Deserialize<'de> for ProtectedActionArgs {
fn deserialize<D: serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
struct _V;
impl<'de> serde::de::Visitor<'de> for _V {
type Value = ProtectedActionArgs;
fn expecting(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_str("struct ProtectedActionArgs")
}
#[allow(clippy::field_reassign_with_default)]
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
mut map: A,
) -> ::core::result::Result<ProtectedActionArgs, A::Error> {
let mut __oneof_args: ::core::option::Option<
__buffa::oneof::protected_action_args::Args,
> = None;
while let Some(key) = map.next_key::<::buffa::alloc::string::String>()? {
match key.as_str() {
"externalWhitelist" | "external_whitelist" => {
let v: ::core::option::Option<ExternalWhitelistArgs> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
ExternalWhitelistArgs,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_args.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'args'",
),
);
}
__oneof_args = Some(
__buffa::oneof::protected_action_args::Args::ExternalWhitelist(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"internalWhitelist" | "internal_whitelist" => {
let v: ::core::option::Option<InternalWhitelistArgs> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
InternalWhitelistArgs,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_args.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'args'",
),
);
}
__oneof_args = Some(
__buffa::oneof::protected_action_args::Args::InternalWhitelist(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
"whitelistRequirement" | "whitelist_requirement" => {
let v: ::core::option::Option<WhitelistRequirementArgs> = map
.next_value_seed(
::buffa::json_helpers::NullableDeserializeSeed(
::buffa::json_helpers::DefaultDeserializeSeed::<
WhitelistRequirementArgs,
>::new(),
),
)?;
if let Some(v) = v {
if __oneof_args.is_some() {
return Err(
serde::de::Error::custom(
"multiple oneof fields set for 'args'",
),
);
}
__oneof_args = Some(
__buffa::oneof::protected_action_args::Args::WhitelistRequirement(
::buffa::alloc::boxed::Box::new(v),
),
);
}
}
_ => {
map.next_value::<serde::de::IgnoredAny>()?;
}
}
}
let mut __r = <ProtectedActionArgs as ::core::default::Default>::default();
__r.args = __oneof_args;
Ok(__r)
}
}
d.deserialize_map(_V)
}
}
impl ::buffa::json_helpers::ProtoElemJson for ProtectedActionArgs {
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 __PROTECTED_ACTION_ARGS_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.ProtectedActionArgs",
to_json: ::buffa::type_registry::any_to_json::<ProtectedActionArgs>,
from_json: ::buffa::type_registry::any_from_json::<ProtectedActionArgs>,
is_wkt: false,
};
pub mod protected_action_args {
#[allow(unused_imports)]
use super::*;
#[doc(inline)]
pub use super::__buffa::oneof::protected_action_args::Args;
#[doc(inline)]
pub use super::__buffa::view::oneof::protected_action_args::Args as ArgsView;
}
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct CreateGuardSignerWalletRequest {
#[serde(
rename = "subaccountId",
alias = "subaccount_id",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)]
pub subaccount_id: u64,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CreateGuardSignerWalletRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CreateGuardSignerWalletRequest")
.field("subaccount_id", &self.subaccount_id)
.finish()
}
}
impl CreateGuardSignerWalletRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.CreateGuardSignerWalletRequest";
}
::buffa::impl_default_instance!(CreateGuardSignerWalletRequest);
impl ::buffa::MessageName for CreateGuardSignerWalletRequest {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "CreateGuardSignerWalletRequest";
const FULL_NAME: &'static str = "chain.guard.v1.CreateGuardSignerWalletRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.CreateGuardSignerWalletRequest";
}
impl ::buffa::Message for CreateGuardSignerWalletRequest {
#[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.subaccount_id != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() 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.subaccount_id != 0u64 {
::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
}
self.__buffa_unknown_fields.write_to(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::Fixed64,
)?;
self.subaccount_id = ::buffa::types::decode_fixed64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.subaccount_id = 0u64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CreateGuardSignerWalletRequest {
const PROTO_FQN: &'static str = "chain.guard.v1.CreateGuardSignerWalletRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for CreateGuardSignerWalletRequest {
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 __CREATE_GUARD_SIGNER_WALLET_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.CreateGuardSignerWalletRequest",
to_json: ::buffa::type_registry::any_to_json::<CreateGuardSignerWalletRequest>,
from_json: ::buffa::type_registry::any_from_json::<CreateGuardSignerWalletRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct CreateGuardSignerWalletResponse {
#[serde(
rename = "signerAddress",
alias = "signer_address",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub signer_address: ::buffa::alloc::string::String,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CreateGuardSignerWalletResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CreateGuardSignerWalletResponse")
.field("signer_address", &self.signer_address)
.finish()
}
}
impl CreateGuardSignerWalletResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.CreateGuardSignerWalletResponse";
}
::buffa::impl_default_instance!(CreateGuardSignerWalletResponse);
impl ::buffa::MessageName for CreateGuardSignerWalletResponse {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "CreateGuardSignerWalletResponse";
const FULL_NAME: &'static str = "chain.guard.v1.CreateGuardSignerWalletResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.CreateGuardSignerWalletResponse";
}
impl ::buffa::Message for CreateGuardSignerWalletResponse {
#[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.signer_address.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.signer_address) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() 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.signer_address.is_empty() {
::buffa::types::put_string_field(1u32, &self.signer_address, buf);
}
self.__buffa_unknown_fields.write_to(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.signer_address, buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.signer_address.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CreateGuardSignerWalletResponse {
const PROTO_FQN: &'static str = "chain.guard.v1.CreateGuardSignerWalletResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for CreateGuardSignerWalletResponse {
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 __CREATE_GUARD_SIGNER_WALLET_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.CreateGuardSignerWalletResponse",
to_json: ::buffa::type_registry::any_to_json::<CreateGuardSignerWalletResponse>,
from_json: ::buffa::type_registry::any_from_json::<CreateGuardSignerWalletResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct GetGuardSignerStatusRequest {
#[serde(
rename = "subaccountId",
alias = "subaccount_id",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)]
pub subaccount_id: u64,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetGuardSignerStatusRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetGuardSignerStatusRequest")
.field("subaccount_id", &self.subaccount_id)
.finish()
}
}
impl GetGuardSignerStatusRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.GetGuardSignerStatusRequest";
}
::buffa::impl_default_instance!(GetGuardSignerStatusRequest);
impl ::buffa::MessageName for GetGuardSignerStatusRequest {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "GetGuardSignerStatusRequest";
const FULL_NAME: &'static str = "chain.guard.v1.GetGuardSignerStatusRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.GetGuardSignerStatusRequest";
}
impl ::buffa::Message for GetGuardSignerStatusRequest {
#[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.subaccount_id != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() 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.subaccount_id != 0u64 {
::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
}
self.__buffa_unknown_fields.write_to(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::Fixed64,
)?;
self.subaccount_id = ::buffa::types::decode_fixed64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.subaccount_id = 0u64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetGuardSignerStatusRequest {
const PROTO_FQN: &'static str = "chain.guard.v1.GetGuardSignerStatusRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for GetGuardSignerStatusRequest {
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_GUARD_SIGNER_STATUS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.GetGuardSignerStatusRequest",
to_json: ::buffa::type_registry::any_to_json::<GetGuardSignerStatusRequest>,
from_json: ::buffa::type_registry::any_from_json::<GetGuardSignerStatusRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct GetGuardSignerStatusResponse {
#[serde(
rename = "status",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)]
pub status: ::buffa::MessageField<GuardSignerStatus>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetGuardSignerStatusResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetGuardSignerStatusResponse")
.field("status", &self.status)
.finish()
}
}
impl GetGuardSignerStatusResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.GetGuardSignerStatusResponse";
}
::buffa::impl_default_instance!(GetGuardSignerStatusResponse);
impl ::buffa::MessageName for GetGuardSignerStatusResponse {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "GetGuardSignerStatusResponse";
const FULL_NAME: &'static str = "chain.guard.v1.GetGuardSignerStatusResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.GetGuardSignerStatusResponse";
}
impl ::buffa::Message for GetGuardSignerStatusResponse {
#[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.status.is_set() {
let __slot = __cache.reserve();
let inner_size = self.status.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() 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.status.is_set() {
::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
self.status.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(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::Message::merge_length_delimited(
self.status.get_or_insert_default(),
buf,
ctx,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.status = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetGuardSignerStatusResponse {
const PROTO_FQN: &'static str = "chain.guard.v1.GetGuardSignerStatusResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for GetGuardSignerStatusResponse {
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_GUARD_SIGNER_STATUS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.GetGuardSignerStatusResponse",
to_json: ::buffa::type_registry::any_to_json::<GetGuardSignerStatusResponse>,
from_json: ::buffa::type_registry::any_from_json::<GetGuardSignerStatusResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct SignProtectedActionRequest {
#[serde(
rename = "subaccountId",
alias = "subaccount_id",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)]
pub subaccount_id: u64,
#[serde(
rename = "action",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)]
pub action: ::buffa::EnumValue<ProtectedAction>,
#[serde(
rename = "args",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)]
pub args: ::buffa::MessageField<ProtectedActionArgs>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SignProtectedActionRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SignProtectedActionRequest")
.field("subaccount_id", &self.subaccount_id)
.field("action", &self.action)
.field("args", &self.args)
.finish()
}
}
impl SignProtectedActionRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.SignProtectedActionRequest";
}
::buffa::impl_default_instance!(SignProtectedActionRequest);
impl ::buffa::MessageName for SignProtectedActionRequest {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "SignProtectedActionRequest";
const FULL_NAME: &'static str = "chain.guard.v1.SignProtectedActionRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.SignProtectedActionRequest";
}
impl ::buffa::Message for SignProtectedActionRequest {
#[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.subaccount_id != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
{
let val = self.action.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.args.is_set() {
let __slot = __cache.reserve();
let inner_size = self.args.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() 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.subaccount_id != 0u64 {
::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
}
{
let val = self.action.to_i32();
if val != 0 {
::buffa::types::put_int32_field(2u32, val, buf);
}
}
if self.args.is_set() {
::buffa::types::put_len_delimited_header(3u32, __cache.consume_next(), buf);
self.args.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(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::Fixed64,
)?;
self.subaccount_id = ::buffa::types::decode_fixed64(buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
self.action = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.args.get_or_insert_default(),
buf,
ctx,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.subaccount_id = 0u64;
self.action = ::buffa::EnumValue::from(0);
self.args = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SignProtectedActionRequest {
const PROTO_FQN: &'static str = "chain.guard.v1.SignProtectedActionRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for SignProtectedActionRequest {
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 __SIGN_PROTECTED_ACTION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.SignProtectedActionRequest",
to_json: ::buffa::type_registry::any_to_json::<SignProtectedActionRequest>,
from_json: ::buffa::type_registry::any_from_json::<SignProtectedActionRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct SignProtectedActionResponse {
#[serde(
rename = "approval",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)]
pub approval: ::buffa::MessageField<GuardApproval>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for SignProtectedActionResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("SignProtectedActionResponse")
.field("approval", &self.approval)
.finish()
}
}
impl SignProtectedActionResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.SignProtectedActionResponse";
}
::buffa::impl_default_instance!(SignProtectedActionResponse);
impl ::buffa::MessageName for SignProtectedActionResponse {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "SignProtectedActionResponse";
const FULL_NAME: &'static str = "chain.guard.v1.SignProtectedActionResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.SignProtectedActionResponse";
}
impl ::buffa::Message for SignProtectedActionResponse {
#[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.approval.is_set() {
let __slot = __cache.reserve();
let inner_size = self.approval.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() 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.approval.is_set() {
::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
self.approval.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(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::Message::merge_length_delimited(
self.approval.get_or_insert_default(),
buf,
ctx,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.approval = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for SignProtectedActionResponse {
const PROTO_FQN: &'static str = "chain.guard.v1.SignProtectedActionResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for SignProtectedActionResponse {
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 __SIGN_PROTECTED_ACTION_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.SignProtectedActionResponse",
to_json: ::buffa::type_registry::any_to_json::<SignProtectedActionResponse>,
from_json: ::buffa::type_registry::any_from_json::<SignProtectedActionResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct BatchSignProtectedActionItem {
#[serde(
rename = "action",
with = "::buffa::json_helpers::proto_enum",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
)]
pub action: ::buffa::EnumValue<ProtectedAction>,
#[serde(
rename = "args",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)]
pub args: ::buffa::MessageField<ProtectedActionArgs>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for BatchSignProtectedActionItem {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BatchSignProtectedActionItem")
.field("action", &self.action)
.field("args", &self.args)
.finish()
}
}
impl BatchSignProtectedActionItem {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.BatchSignProtectedActionItem";
}
::buffa::impl_default_instance!(BatchSignProtectedActionItem);
impl ::buffa::MessageName for BatchSignProtectedActionItem {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "BatchSignProtectedActionItem";
const FULL_NAME: &'static str = "chain.guard.v1.BatchSignProtectedActionItem";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.BatchSignProtectedActionItem";
}
impl ::buffa::Message for BatchSignProtectedActionItem {
#[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;
{
let val = self.action.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.args.is_set() {
let __slot = __cache.reserve();
let inner_size = self.args.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
{
let val = self.action.to_i32();
if val != 0 {
::buffa::types::put_int32_field(1u32, val, buf);
}
}
if self.args.is_set() {
::buffa::types::put_len_delimited_header(2u32, __cache.consume_next(), buf);
self.args.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(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::Varint,
)?;
self.action = ::buffa::EnumValue::from(
::buffa::types::decode_int32(buf)?,
);
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.args.get_or_insert_default(),
buf,
ctx,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.action = ::buffa::EnumValue::from(0);
self.args = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for BatchSignProtectedActionItem {
const PROTO_FQN: &'static str = "chain.guard.v1.BatchSignProtectedActionItem";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for BatchSignProtectedActionItem {
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 __BATCH_SIGN_PROTECTED_ACTION_ITEM_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.BatchSignProtectedActionItem",
to_json: ::buffa::type_registry::any_to_json::<BatchSignProtectedActionItem>,
from_json: ::buffa::type_registry::any_from_json::<BatchSignProtectedActionItem>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct BatchSignProtectedActionsRequest {
#[serde(
rename = "subaccountId",
alias = "subaccount_id",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)]
pub subaccount_id: u64,
#[serde(
rename = "actions",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub actions: ::buffa::alloc::vec::Vec<BatchSignProtectedActionItem>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for BatchSignProtectedActionsRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BatchSignProtectedActionsRequest")
.field("subaccount_id", &self.subaccount_id)
.field("actions", &self.actions)
.finish()
}
}
impl BatchSignProtectedActionsRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.BatchSignProtectedActionsRequest";
}
::buffa::impl_default_instance!(BatchSignProtectedActionsRequest);
impl ::buffa::MessageName for BatchSignProtectedActionsRequest {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "BatchSignProtectedActionsRequest";
const FULL_NAME: &'static str = "chain.guard.v1.BatchSignProtectedActionsRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.BatchSignProtectedActionsRequest";
}
impl ::buffa::Message for BatchSignProtectedActionsRequest {
#[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.subaccount_id != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
for v in &self.actions {
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 += self.__buffa_unknown_fields.encoded_len() 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.subaccount_id != 0u64 {
::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
}
for v in &self.actions {
::buffa::types::put_len_delimited_header(2u32, __cache.consume_next(), buf);
v.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(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::Fixed64,
)?;
self.subaccount_id = ::buffa::types::decode_fixed64(buf)?;
}
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.actions.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.subaccount_id = 0u64;
self.actions.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for BatchSignProtectedActionsRequest {
const PROTO_FQN: &'static str = "chain.guard.v1.BatchSignProtectedActionsRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for BatchSignProtectedActionsRequest {
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 __BATCH_SIGN_PROTECTED_ACTIONS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.BatchSignProtectedActionsRequest",
to_json: ::buffa::type_registry::any_to_json::<BatchSignProtectedActionsRequest>,
from_json: ::buffa::type_registry::any_from_json::<BatchSignProtectedActionsRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct BatchSignProtectedActionsResponse {
#[serde(
rename = "approvals",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub approvals: ::buffa::alloc::vec::Vec<GuardApproval>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for BatchSignProtectedActionsResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BatchSignProtectedActionsResponse")
.field("approvals", &self.approvals)
.finish()
}
}
impl BatchSignProtectedActionsResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.BatchSignProtectedActionsResponse";
}
::buffa::impl_default_instance!(BatchSignProtectedActionsResponse);
impl ::buffa::MessageName for BatchSignProtectedActionsResponse {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "BatchSignProtectedActionsResponse";
const FULL_NAME: &'static str = "chain.guard.v1.BatchSignProtectedActionsResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.BatchSignProtectedActionsResponse";
}
impl ::buffa::Message for BatchSignProtectedActionsResponse {
#[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.approvals {
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 += self.__buffa_unknown_fields.encoded_len() as u32;
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.approvals {
::buffa::types::put_len_delimited_header(1u32, __cache.consume_next(), buf);
v.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(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.approvals.push(elem);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.approvals.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for BatchSignProtectedActionsResponse {
const PROTO_FQN: &'static str = "chain.guard.v1.BatchSignProtectedActionsResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for BatchSignProtectedActionsResponse {
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 __BATCH_SIGN_PROTECTED_ACTIONS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.BatchSignProtectedActionsResponse",
to_json: ::buffa::type_registry::any_to_json::<BatchSignProtectedActionsResponse>,
from_json: ::buffa::type_registry::any_from_json::<
BatchSignProtectedActionsResponse,
>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct RotateGuardSignerWalletRequest {
#[serde(
rename = "subaccountId",
alias = "subaccount_id",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)]
pub subaccount_id: u64,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for RotateGuardSignerWalletRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("RotateGuardSignerWalletRequest")
.field("subaccount_id", &self.subaccount_id)
.finish()
}
}
impl RotateGuardSignerWalletRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.RotateGuardSignerWalletRequest";
}
::buffa::impl_default_instance!(RotateGuardSignerWalletRequest);
impl ::buffa::MessageName for RotateGuardSignerWalletRequest {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "RotateGuardSignerWalletRequest";
const FULL_NAME: &'static str = "chain.guard.v1.RotateGuardSignerWalletRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.RotateGuardSignerWalletRequest";
}
impl ::buffa::Message for RotateGuardSignerWalletRequest {
#[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.subaccount_id != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() 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.subaccount_id != 0u64 {
::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
}
self.__buffa_unknown_fields.write_to(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::Fixed64,
)?;
self.subaccount_id = ::buffa::types::decode_fixed64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.subaccount_id = 0u64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for RotateGuardSignerWalletRequest {
const PROTO_FQN: &'static str = "chain.guard.v1.RotateGuardSignerWalletRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for RotateGuardSignerWalletRequest {
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 __ROTATE_GUARD_SIGNER_WALLET_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.RotateGuardSignerWalletRequest",
to_json: ::buffa::type_registry::any_to_json::<RotateGuardSignerWalletRequest>,
from_json: ::buffa::type_registry::any_from_json::<RotateGuardSignerWalletRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct RotateGuardSignerWalletResponse {
#[serde(
rename = "newSignerAddress",
alias = "new_signer_address",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub new_signer_address: ::buffa::alloc::string::String,
#[serde(
rename = "approval",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_unset_message_field"
)]
pub approval: ::buffa::MessageField<GuardApproval>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for RotateGuardSignerWalletResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("RotateGuardSignerWalletResponse")
.field("new_signer_address", &self.new_signer_address)
.field("approval", &self.approval)
.finish()
}
}
impl RotateGuardSignerWalletResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.RotateGuardSignerWalletResponse";
}
::buffa::impl_default_instance!(RotateGuardSignerWalletResponse);
impl ::buffa::MessageName for RotateGuardSignerWalletResponse {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "RotateGuardSignerWalletResponse";
const FULL_NAME: &'static str = "chain.guard.v1.RotateGuardSignerWalletResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.RotateGuardSignerWalletResponse";
}
impl ::buffa::Message for RotateGuardSignerWalletResponse {
#[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.new_signer_address.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.new_signer_address)
as u32;
}
if self.approval.is_set() {
let __slot = __cache.reserve();
let inner_size = self.approval.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() 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.new_signer_address.is_empty() {
::buffa::types::put_string_field(1u32, &self.new_signer_address, buf);
}
if self.approval.is_set() {
::buffa::types::put_len_delimited_header(2u32, __cache.consume_next(), buf);
self.approval.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(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.new_signer_address, buf)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
::buffa::Message::merge_length_delimited(
self.approval.get_or_insert_default(),
buf,
ctx,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.new_signer_address.clear();
self.approval = ::buffa::MessageField::none();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for RotateGuardSignerWalletResponse {
const PROTO_FQN: &'static str = "chain.guard.v1.RotateGuardSignerWalletResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for RotateGuardSignerWalletResponse {
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 __ROTATE_GUARD_SIGNER_WALLET_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.RotateGuardSignerWalletResponse",
to_json: ::buffa::type_registry::any_to_json::<RotateGuardSignerWalletResponse>,
from_json: ::buffa::type_registry::any_from_json::<RotateGuardSignerWalletResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct ExportGuardSignerWalletRequest {
#[serde(
rename = "subaccountId",
alias = "subaccount_id",
with = "::buffa::json_helpers::uint64",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_u64"
)]
pub subaccount_id: u64,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ExportGuardSignerWalletRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ExportGuardSignerWalletRequest")
.field("subaccount_id", &self.subaccount_id)
.finish()
}
}
impl ExportGuardSignerWalletRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.ExportGuardSignerWalletRequest";
}
::buffa::impl_default_instance!(ExportGuardSignerWalletRequest);
impl ::buffa::MessageName for ExportGuardSignerWalletRequest {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "ExportGuardSignerWalletRequest";
const FULL_NAME: &'static str = "chain.guard.v1.ExportGuardSignerWalletRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.ExportGuardSignerWalletRequest";
}
impl ::buffa::Message for ExportGuardSignerWalletRequest {
#[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.subaccount_id != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() 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.subaccount_id != 0u64 {
::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
}
self.__buffa_unknown_fields.write_to(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::Fixed64,
)?;
self.subaccount_id = ::buffa::types::decode_fixed64(buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.subaccount_id = 0u64;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ExportGuardSignerWalletRequest {
const PROTO_FQN: &'static str = "chain.guard.v1.ExportGuardSignerWalletRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for ExportGuardSignerWalletRequest {
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 __EXPORT_GUARD_SIGNER_WALLET_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.ExportGuardSignerWalletRequest",
to_json: ::buffa::type_registry::any_to_json::<ExportGuardSignerWalletRequest>,
from_json: ::buffa::type_registry::any_from_json::<ExportGuardSignerWalletRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct ExportGuardSignerWalletResponse {
#[serde(
rename = "privateKey",
alias = "private_key",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub private_key: ::buffa::alloc::string::String,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ExportGuardSignerWalletResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ExportGuardSignerWalletResponse")
.field("private_key", &self.private_key)
.finish()
}
}
impl ExportGuardSignerWalletResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.ExportGuardSignerWalletResponse";
}
::buffa::impl_default_instance!(ExportGuardSignerWalletResponse);
impl ::buffa::MessageName for ExportGuardSignerWalletResponse {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "ExportGuardSignerWalletResponse";
const FULL_NAME: &'static str = "chain.guard.v1.ExportGuardSignerWalletResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.ExportGuardSignerWalletResponse";
}
impl ::buffa::Message for ExportGuardSignerWalletResponse {
#[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.private_key.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.private_key) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() 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.private_key.is_empty() {
::buffa::types::put_string_field(1u32, &self.private_key, buf);
}
self.__buffa_unknown_fields.write_to(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.private_key, buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, ctx)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.private_key.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ExportGuardSignerWalletResponse {
const PROTO_FQN: &'static str = "chain.guard.v1.ExportGuardSignerWalletResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for ExportGuardSignerWalletResponse {
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 __EXPORT_GUARD_SIGNER_WALLET_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/chain.guard.v1.ExportGuardSignerWalletResponse",
to_json: ::buffa::type_registry::any_to_json::<ExportGuardSignerWalletResponse>,
from_json: ::buffa::type_registry::any_from_json::<ExportGuardSignerWalletResponse>,
is_wkt: false,
};
#[allow(
non_camel_case_types,
dead_code,
unused_imports,
unused_qualifications,
clippy::derivable_impls,
clippy::match_single_binding,
clippy::uninlined_format_args,
clippy::doc_lazy_continuation,
clippy::module_inception
)]
pub mod __buffa {
#[allow(unused_imports)]
use super::*;
pub mod view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, Default)]
pub struct GuardSignerStatusView<'a> {
pub signer_address: &'a str,
pub onchain_signer_address: &'a str,
pub initialized: bool,
pub nonce: &'a str,
pub nonce_space: u64,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for GuardSignerStatusView<'a> {
type Owned = super::super::GuardSignerStatus;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.signer_address = ::buffa::types::borrow_str(&mut cur)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.onchain_signer_address = ::buffa::types::borrow_str(
&mut cur,
)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.initialized = ::buffa::types::decode_bool(&mut cur)?;
}
4u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.nonce = ::buffa::types::borrow_str(&mut cur)?;
}
5u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.nonce_space = ::buffa::types::decode_uint64(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::GuardSignerStatus,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::GuardSignerStatus,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::GuardSignerStatus {
signer_address: self.signer_address.to_string(),
onchain_signer_address: self.onchain_signer_address.to_string(),
initialized: self.initialized,
nonce: self.nonce.to_string(),
nonce_space: self.nonce_space,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for GuardSignerStatusView<'a> {
#[allow(clippy::needless_borrow, 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.signer_address.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.signer_address)
as u32;
}
if !self.onchain_signer_address.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(
&self.onchain_signer_address,
) as u32;
}
if self.initialized {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if !self.nonce.is_empty() {
size
+= 1u32 + ::buffa::types::string_encoded_len(&self.nonce) as u32;
}
if self.nonce_space != 0u64 {
size
+= 1u32
+ ::buffa::types::uint64_encoded_len(self.nonce_space)
as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.signer_address.is_empty() {
::buffa::types::put_string_field(1u32, &self.signer_address, buf);
}
if !self.onchain_signer_address.is_empty() {
::buffa::types::put_string_field(
2u32,
&self.onchain_signer_address,
buf,
);
}
if self.initialized {
::buffa::types::put_bool_field(3u32, self.initialized, buf);
}
if !self.nonce.is_empty() {
::buffa::types::put_string_field(4u32, &self.nonce, buf);
}
if self.nonce_space != 0u64 {
::buffa::types::put_uint64_field(5u32, self.nonce_space, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for GuardSignerStatusView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_empty_str(self.signer_address) {
__map.serialize_entry("signerAddress", self.signer_address)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(
self.onchain_signer_address,
) {
__map
.serialize_entry(
"onchainSignerAddress",
self.onchain_signer_address,
)?;
}
if self.initialized {
__map.serialize_entry("initialized", &self.initialized)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.nonce) {
__map.serialize_entry("nonce", self.nonce)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u64(&self.nonce_space) {
__map
.serialize_entry(
"nonceSpace",
&::buffa::json_helpers::ProtoJson(&self.nonce_space),
)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for GuardSignerStatusView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "GuardSignerStatus";
const FULL_NAME: &'static str = "chain.guard.v1.GuardSignerStatus";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.GuardSignerStatus";
}
::buffa::impl_default_view_instance!(GuardSignerStatusView);
::buffa::impl_view_reborrow!(GuardSignerStatusView);
#[derive(Clone, Debug)]
pub struct GuardSignerStatusOwnedView(
::buffa::OwnedView<GuardSignerStatusView<'static>>,
);
impl GuardSignerStatusOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GuardSignerStatusOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GuardSignerStatusOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::GuardSignerStatus,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GuardSignerStatusOwnedView(::buffa::OwnedView::from_owned(msg)?),
)
}
#[must_use]
pub fn view(&self) -> &GuardSignerStatusView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::GuardSignerStatus,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn signer_address(&self) -> &'_ str {
self.0.reborrow().signer_address
}
#[must_use]
pub fn onchain_signer_address(&self) -> &'_ str {
self.0.reborrow().onchain_signer_address
}
#[must_use]
pub fn initialized(&self) -> bool {
self.0.reborrow().initialized
}
#[must_use]
pub fn nonce(&self) -> &'_ str {
self.0.reborrow().nonce
}
#[must_use]
pub fn nonce_space(&self) -> u64 {
self.0.reborrow().nonce_space
}
}
impl ::core::convert::From<::buffa::OwnedView<GuardSignerStatusView<'static>>>
for GuardSignerStatusOwnedView {
fn from(inner: ::buffa::OwnedView<GuardSignerStatusView<'static>>) -> Self {
GuardSignerStatusOwnedView(inner)
}
}
impl ::core::convert::From<GuardSignerStatusOwnedView>
for ::buffa::OwnedView<GuardSignerStatusView<'static>> {
fn from(wrapper: GuardSignerStatusOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<::buffa::OwnedView<GuardSignerStatusView<'static>>>
for GuardSignerStatusOwnedView {
fn as_ref(&self) -> &::buffa::OwnedView<GuardSignerStatusView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::GuardSignerStatus {
type View<'a> = GuardSignerStatusView<'a>;
type ViewHandle = GuardSignerStatusOwnedView;
}
impl ::serde::Serialize for GuardSignerStatusOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct GuardApprovalView<'a> {
pub nonce_space: u64,
pub deadline_unix: u64,
pub signature: &'a [u8],
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for GuardApprovalView<'a> {
type Owned = super::super::GuardApproval;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.nonce_space = ::buffa::types::decode_uint64(&mut cur)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.deadline_unix = ::buffa::types::decode_uint64(&mut cur)?;
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.signature = ::buffa::types::borrow_bytes(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::GuardApproval,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::GuardApproval,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::GuardApproval {
nonce_space: self.nonce_space,
deadline_unix: self.deadline_unix,
signature: (self.signature).to_vec(),
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for GuardApprovalView<'a> {
#[allow(clippy::needless_borrow, 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.nonce_space != 0u64 {
size
+= 1u32
+ ::buffa::types::uint64_encoded_len(self.nonce_space)
as u32;
}
if self.deadline_unix != 0u64 {
size
+= 1u32
+ ::buffa::types::uint64_encoded_len(self.deadline_unix)
as u32;
}
if !self.signature.is_empty() {
size
+= 1u32
+ ::buffa::types::bytes_encoded_len(&self.signature) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.nonce_space != 0u64 {
::buffa::types::put_uint64_field(1u32, self.nonce_space, buf);
}
if self.deadline_unix != 0u64 {
::buffa::types::put_uint64_field(2u32, self.deadline_unix, buf);
}
if !self.signature.is_empty() {
::buffa::types::put_bytes_field(3u32, &self.signature, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for GuardApprovalView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_zero_u64(&self.nonce_space) {
__map
.serialize_entry(
"nonceSpace",
&::buffa::json_helpers::ProtoJson(&self.nonce_space),
)?;
}
if !::buffa::json_helpers::skip_if::is_zero_u64(&self.deadline_unix) {
__map
.serialize_entry(
"deadlineUnix",
&::buffa::json_helpers::ProtoJson(&self.deadline_unix),
)?;
}
if !::buffa::json_helpers::skip_if::is_empty_bytes(self.signature) {
__map
.serialize_entry(
"signature",
&::buffa::json_helpers::BytesJson(self.signature),
)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for GuardApprovalView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "GuardApproval";
const FULL_NAME: &'static str = "chain.guard.v1.GuardApproval";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.GuardApproval";
}
::buffa::impl_default_view_instance!(GuardApprovalView);
::buffa::impl_view_reborrow!(GuardApprovalView);
#[derive(Clone, Debug)]
pub struct GuardApprovalOwnedView(
::buffa::OwnedView<GuardApprovalView<'static>>,
);
impl GuardApprovalOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GuardApprovalOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GuardApprovalOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::GuardApproval,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GuardApprovalOwnedView(::buffa::OwnedView::from_owned(msg)?),
)
}
#[must_use]
pub fn view(&self) -> &GuardApprovalView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::GuardApproval,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn nonce_space(&self) -> u64 {
self.0.reborrow().nonce_space
}
#[must_use]
pub fn deadline_unix(&self) -> u64 {
self.0.reborrow().deadline_unix
}
#[must_use]
pub fn signature(&self) -> &'_ [u8] {
self.0.reborrow().signature
}
}
impl ::core::convert::From<::buffa::OwnedView<GuardApprovalView<'static>>>
for GuardApprovalOwnedView {
fn from(inner: ::buffa::OwnedView<GuardApprovalView<'static>>) -> Self {
GuardApprovalOwnedView(inner)
}
}
impl ::core::convert::From<GuardApprovalOwnedView>
for ::buffa::OwnedView<GuardApprovalView<'static>> {
fn from(wrapper: GuardApprovalOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<::buffa::OwnedView<GuardApprovalView<'static>>>
for GuardApprovalOwnedView {
fn as_ref(&self) -> &::buffa::OwnedView<GuardApprovalView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::GuardApproval {
type View<'a> = GuardApprovalView<'a>;
type ViewHandle = GuardApprovalOwnedView;
}
impl ::serde::Serialize for GuardApprovalOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct ExternalWhitelistArgsView<'a> {
pub polychain_chain_id: u32,
pub addresses: ::buffa::RepeatedView<'a, &'a str>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for ExternalWhitelistArgsView<'a> {
type Owned = super::super::ExternalWhitelistArgs;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.polychain_chain_id = ::buffa::types::decode_uint32(
&mut cur,
)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.addresses.push(::buffa::types::borrow_str(&mut cur)?);
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ExternalWhitelistArgs,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::ExternalWhitelistArgs,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::ExternalWhitelistArgs {
polychain_chain_id: self.polychain_chain_id,
addresses: self.addresses.iter().map(|s| s.to_string()).collect(),
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for ExternalWhitelistArgsView<'a> {
#[allow(clippy::needless_borrow, 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.polychain_chain_id != 0u32 {
size
+= 1u32
+ ::buffa::types::uint32_encoded_len(self.polychain_chain_id)
as u32;
}
for v in &self.addresses {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.polychain_chain_id != 0u32 {
::buffa::types::put_uint32_field(1u32, self.polychain_chain_id, buf);
}
for v in &self.addresses {
::buffa::types::put_string_field(2u32, v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for ExternalWhitelistArgsView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_zero_u32(
&self.polychain_chain_id,
) {
__map
.serialize_entry(
"polychainChainId",
&::buffa::json_helpers::ProtoJson(&self.polychain_chain_id),
)?;
}
if !self.addresses.is_empty() {
__map.serialize_entry("addresses", &*self.addresses)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for ExternalWhitelistArgsView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "ExternalWhitelistArgs";
const FULL_NAME: &'static str = "chain.guard.v1.ExternalWhitelistArgs";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.ExternalWhitelistArgs";
}
::buffa::impl_default_view_instance!(ExternalWhitelistArgsView);
::buffa::impl_view_reborrow!(ExternalWhitelistArgsView);
#[derive(Clone, Debug)]
pub struct ExternalWhitelistArgsOwnedView(
::buffa::OwnedView<ExternalWhitelistArgsView<'static>>,
);
impl ExternalWhitelistArgsOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ExternalWhitelistArgsOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ExternalWhitelistArgsOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::ExternalWhitelistArgs,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ExternalWhitelistArgsOwnedView(::buffa::OwnedView::from_owned(msg)?),
)
}
#[must_use]
pub fn view(&self) -> &ExternalWhitelistArgsView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ExternalWhitelistArgs,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn polychain_chain_id(&self) -> u32 {
self.0.reborrow().polychain_chain_id
}
#[must_use]
pub fn addresses(&self) -> &::buffa::RepeatedView<'_, &'_ str> {
&self.0.reborrow().addresses
}
}
impl ::core::convert::From<
::buffa::OwnedView<ExternalWhitelistArgsView<'static>>,
> for ExternalWhitelistArgsOwnedView {
fn from(
inner: ::buffa::OwnedView<ExternalWhitelistArgsView<'static>>,
) -> Self {
ExternalWhitelistArgsOwnedView(inner)
}
}
impl ::core::convert::From<ExternalWhitelistArgsOwnedView>
for ::buffa::OwnedView<ExternalWhitelistArgsView<'static>> {
fn from(wrapper: ExternalWhitelistArgsOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<ExternalWhitelistArgsView<'static>>,
> for ExternalWhitelistArgsOwnedView {
fn as_ref(&self) -> &::buffa::OwnedView<ExternalWhitelistArgsView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::ExternalWhitelistArgs {
type View<'a> = ExternalWhitelistArgsView<'a>;
type ViewHandle = ExternalWhitelistArgsOwnedView;
}
impl ::serde::Serialize for ExternalWhitelistArgsOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct InternalWhitelistArgsView<'a> {
pub addresses: ::buffa::RepeatedView<'a, &'a str>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for InternalWhitelistArgsView<'a> {
type Owned = super::super::InternalWhitelistArgs;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.addresses.push(::buffa::types::borrow_str(&mut cur)?);
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::InternalWhitelistArgs,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::InternalWhitelistArgs,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::InternalWhitelistArgs {
addresses: self.addresses.iter().map(|s| s.to_string()).collect(),
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for InternalWhitelistArgsView<'a> {
#[allow(clippy::needless_borrow, 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.addresses {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
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.addresses {
::buffa::types::put_string_field(1u32, v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for InternalWhitelistArgsView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !self.addresses.is_empty() {
__map.serialize_entry("addresses", &*self.addresses)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for InternalWhitelistArgsView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "InternalWhitelistArgs";
const FULL_NAME: &'static str = "chain.guard.v1.InternalWhitelistArgs";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.InternalWhitelistArgs";
}
::buffa::impl_default_view_instance!(InternalWhitelistArgsView);
::buffa::impl_view_reborrow!(InternalWhitelistArgsView);
#[derive(Clone, Debug)]
pub struct InternalWhitelistArgsOwnedView(
::buffa::OwnedView<InternalWhitelistArgsView<'static>>,
);
impl InternalWhitelistArgsOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
InternalWhitelistArgsOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
InternalWhitelistArgsOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::InternalWhitelistArgs,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
InternalWhitelistArgsOwnedView(::buffa::OwnedView::from_owned(msg)?),
)
}
#[must_use]
pub fn view(&self) -> &InternalWhitelistArgsView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::InternalWhitelistArgs,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn addresses(&self) -> &::buffa::RepeatedView<'_, &'_ str> {
&self.0.reborrow().addresses
}
}
impl ::core::convert::From<
::buffa::OwnedView<InternalWhitelistArgsView<'static>>,
> for InternalWhitelistArgsOwnedView {
fn from(
inner: ::buffa::OwnedView<InternalWhitelistArgsView<'static>>,
) -> Self {
InternalWhitelistArgsOwnedView(inner)
}
}
impl ::core::convert::From<InternalWhitelistArgsOwnedView>
for ::buffa::OwnedView<InternalWhitelistArgsView<'static>> {
fn from(wrapper: InternalWhitelistArgsOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<InternalWhitelistArgsView<'static>>,
> for InternalWhitelistArgsOwnedView {
fn as_ref(&self) -> &::buffa::OwnedView<InternalWhitelistArgsView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::InternalWhitelistArgs {
type View<'a> = InternalWhitelistArgsView<'a>;
type ViewHandle = InternalWhitelistArgsOwnedView;
}
impl ::serde::Serialize for InternalWhitelistArgsOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct WhitelistRequirementArgsView<'a> {
pub required: bool,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for WhitelistRequirementArgsView<'a> {
type Owned = super::super::WhitelistRequirementArgs;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.required = ::buffa::types::decode_bool(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::WhitelistRequirementArgs,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::WhitelistRequirementArgs,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::WhitelistRequirementArgs {
required: self.required,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for WhitelistRequirementArgsView<'a> {
#[allow(clippy::needless_borrow, 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.required {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.required {
::buffa::types::put_bool_field(1u32, self.required, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for WhitelistRequirementArgsView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if self.required {
__map.serialize_entry("required", &self.required)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for WhitelistRequirementArgsView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "WhitelistRequirementArgs";
const FULL_NAME: &'static str = "chain.guard.v1.WhitelistRequirementArgs";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.WhitelistRequirementArgs";
}
::buffa::impl_default_view_instance!(WhitelistRequirementArgsView);
::buffa::impl_view_reborrow!(WhitelistRequirementArgsView);
#[derive(Clone, Debug)]
pub struct WhitelistRequirementArgsOwnedView(
::buffa::OwnedView<WhitelistRequirementArgsView<'static>>,
);
impl WhitelistRequirementArgsOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
WhitelistRequirementArgsOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
WhitelistRequirementArgsOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::WhitelistRequirementArgs,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
WhitelistRequirementArgsOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &WhitelistRequirementArgsView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::WhitelistRequirementArgs,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn required(&self) -> bool {
self.0.reborrow().required
}
}
impl ::core::convert::From<
::buffa::OwnedView<WhitelistRequirementArgsView<'static>>,
> for WhitelistRequirementArgsOwnedView {
fn from(
inner: ::buffa::OwnedView<WhitelistRequirementArgsView<'static>>,
) -> Self {
WhitelistRequirementArgsOwnedView(inner)
}
}
impl ::core::convert::From<WhitelistRequirementArgsOwnedView>
for ::buffa::OwnedView<WhitelistRequirementArgsView<'static>> {
fn from(wrapper: WhitelistRequirementArgsOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<WhitelistRequirementArgsView<'static>>,
> for WhitelistRequirementArgsOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<WhitelistRequirementArgsView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::WhitelistRequirementArgs {
type View<'a> = WhitelistRequirementArgsView<'a>;
type ViewHandle = WhitelistRequirementArgsOwnedView;
}
impl ::serde::Serialize for WhitelistRequirementArgsOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct ProtectedActionArgsView<'a> {
pub args: ::core::option::Option<
super::super::__buffa::view::oneof::protected_action_args::Args<'a>,
>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for ProtectedActionArgsView<'a> {
type Owned = super::super::ProtectedActionArgs;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
if let Some(
super::super::__buffa::view::oneof::protected_action_args::Args::ExternalWhitelist(
ref mut existing,
),
) = view.args
{
::buffa::MessageView::merge_into_view(
&mut **existing,
sub,
__sub_ctx,
)?;
} else {
view.args = Some(
super::super::__buffa::view::oneof::protected_action_args::Args::ExternalWhitelist(
::buffa::alloc::boxed::Box::new(
<super::super::__buffa::view::ExternalWhitelistArgsView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
),
),
);
}
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
if let Some(
super::super::__buffa::view::oneof::protected_action_args::Args::InternalWhitelist(
ref mut existing,
),
) = view.args
{
::buffa::MessageView::merge_into_view(
&mut **existing,
sub,
__sub_ctx,
)?;
} else {
view.args = Some(
super::super::__buffa::view::oneof::protected_action_args::Args::InternalWhitelist(
::buffa::alloc::boxed::Box::new(
<super::super::__buffa::view::InternalWhitelistArgsView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
),
),
);
}
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
if let Some(
super::super::__buffa::view::oneof::protected_action_args::Args::WhitelistRequirement(
ref mut existing,
),
) = view.args
{
::buffa::MessageView::merge_into_view(
&mut **existing,
sub,
__sub_ctx,
)?;
} else {
view.args = Some(
super::super::__buffa::view::oneof::protected_action_args::Args::WhitelistRequirement(
::buffa::alloc::boxed::Box::new(
<super::super::__buffa::view::WhitelistRequirementArgsView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
),
),
);
}
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ProtectedActionArgs,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::ProtectedActionArgs,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::ProtectedActionArgs {
args: match self.args.as_ref() {
::core::option::Option::Some(v) => {
::core::option::Option::Some(
match v {
super::super::__buffa::view::oneof::protected_action_args::Args::ExternalWhitelist(
v,
) => {
super::super::__buffa::oneof::protected_action_args::Args::ExternalWhitelist(
::buffa::alloc::boxed::Box::new(
v.to_owned_from_source(__buffa_src)?,
),
)
}
super::super::__buffa::view::oneof::protected_action_args::Args::InternalWhitelist(
v,
) => {
super::super::__buffa::oneof::protected_action_args::Args::InternalWhitelist(
::buffa::alloc::boxed::Box::new(
v.to_owned_from_source(__buffa_src)?,
),
)
}
super::super::__buffa::view::oneof::protected_action_args::Args::WhitelistRequirement(
v,
) => {
super::super::__buffa::oneof::protected_action_args::Args::WhitelistRequirement(
::buffa::alloc::boxed::Box::new(
v.to_owned_from_source(__buffa_src)?,
),
)
}
},
)
}
::core::option::Option::None => ::core::option::Option::None,
},
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for ProtectedActionArgsView<'a> {
#[allow(clippy::needless_borrow, 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 let ::core::option::Option::Some(ref v) = self.args {
match v {
super::super::__buffa::view::oneof::protected_action_args::Args::ExternalWhitelist(
x,
) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
super::super::__buffa::view::oneof::protected_action_args::Args::InternalWhitelist(
x,
) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
super::super::__buffa::view::oneof::protected_action_args::Args::WhitelistRequirement(
x,
) => {
let __slot = __cache.reserve();
let inner = x.compute_size(__cache);
__cache.set(__slot, inner);
size
+= 1u32 + ::buffa::encoding::varint_len(inner as u64) as u32
+ inner;
}
}
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let ::core::option::Option::Some(ref v) = self.args {
match v {
super::super::__buffa::view::oneof::protected_action_args::Args::ExternalWhitelist(
x,
) => {
::buffa::types::put_len_delimited_header(
1u32,
__cache.consume_next(),
buf,
);
x.write_to(__cache, buf);
}
super::super::__buffa::view::oneof::protected_action_args::Args::InternalWhitelist(
x,
) => {
::buffa::types::put_len_delimited_header(
2u32,
__cache.consume_next(),
buf,
);
x.write_to(__cache, buf);
}
super::super::__buffa::view::oneof::protected_action_args::Args::WhitelistRequirement(
x,
) => {
::buffa::types::put_len_delimited_header(
3u32,
__cache.consume_next(),
buf,
);
x.write_to(__cache, buf);
}
}
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for ProtectedActionArgsView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if let ::core::option::Option::Some(ref __ov) = self.args {
match __ov {
super::super::__buffa::view::oneof::protected_action_args::Args::ExternalWhitelist(
v,
) => {
__map.serialize_entry("externalWhitelist", v)?;
}
super::super::__buffa::view::oneof::protected_action_args::Args::InternalWhitelist(
v,
) => {
__map.serialize_entry("internalWhitelist", v)?;
}
super::super::__buffa::view::oneof::protected_action_args::Args::WhitelistRequirement(
v,
) => {
__map.serialize_entry("whitelistRequirement", v)?;
}
}
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for ProtectedActionArgsView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "ProtectedActionArgs";
const FULL_NAME: &'static str = "chain.guard.v1.ProtectedActionArgs";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.ProtectedActionArgs";
}
::buffa::impl_default_view_instance!(ProtectedActionArgsView);
::buffa::impl_view_reborrow!(ProtectedActionArgsView);
#[derive(Clone, Debug)]
pub struct ProtectedActionArgsOwnedView(
::buffa::OwnedView<ProtectedActionArgsView<'static>>,
);
impl ProtectedActionArgsOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ProtectedActionArgsOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ProtectedActionArgsOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::ProtectedActionArgs,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ProtectedActionArgsOwnedView(::buffa::OwnedView::from_owned(msg)?),
)
}
#[must_use]
pub fn view(&self) -> &ProtectedActionArgsView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ProtectedActionArgs,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn args(
&self,
) -> ::core::option::Option<
&super::super::__buffa::view::oneof::protected_action_args::Args<'_>,
> {
self.0.reborrow().args.as_ref()
}
}
impl ::core::convert::From<::buffa::OwnedView<ProtectedActionArgsView<'static>>>
for ProtectedActionArgsOwnedView {
fn from(
inner: ::buffa::OwnedView<ProtectedActionArgsView<'static>>,
) -> Self {
ProtectedActionArgsOwnedView(inner)
}
}
impl ::core::convert::From<ProtectedActionArgsOwnedView>
for ::buffa::OwnedView<ProtectedActionArgsView<'static>> {
fn from(wrapper: ProtectedActionArgsOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<::buffa::OwnedView<ProtectedActionArgsView<'static>>>
for ProtectedActionArgsOwnedView {
fn as_ref(&self) -> &::buffa::OwnedView<ProtectedActionArgsView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::ProtectedActionArgs {
type View<'a> = ProtectedActionArgsView<'a>;
type ViewHandle = ProtectedActionArgsOwnedView;
}
impl ::serde::Serialize for ProtectedActionArgsOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct CreateGuardSignerWalletRequestView<'a> {
pub subaccount_id: u64,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for CreateGuardSignerWalletRequestView<'a> {
type Owned = super::super::CreateGuardSignerWalletRequest;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Fixed64,
)?;
view.subaccount_id = ::buffa::types::decode_fixed64(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::CreateGuardSignerWalletRequest,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::CreateGuardSignerWalletRequest,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::CreateGuardSignerWalletRequest {
subaccount_id: self.subaccount_id,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for CreateGuardSignerWalletRequestView<'a> {
#[allow(clippy::needless_borrow, 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.subaccount_id != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.subaccount_id != 0u64 {
::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for CreateGuardSignerWalletRequestView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_zero_u64(&self.subaccount_id) {
__map
.serialize_entry(
"subaccountId",
&::buffa::json_helpers::ProtoJson(&self.subaccount_id),
)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for CreateGuardSignerWalletRequestView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "CreateGuardSignerWalletRequest";
const FULL_NAME: &'static str = "chain.guard.v1.CreateGuardSignerWalletRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.CreateGuardSignerWalletRequest";
}
::buffa::impl_default_view_instance!(CreateGuardSignerWalletRequestView);
::buffa::impl_view_reborrow!(CreateGuardSignerWalletRequestView);
#[derive(Clone, Debug)]
pub struct CreateGuardSignerWalletRequestOwnedView(
::buffa::OwnedView<CreateGuardSignerWalletRequestView<'static>>,
);
impl CreateGuardSignerWalletRequestOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
CreateGuardSignerWalletRequestOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
CreateGuardSignerWalletRequestOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::CreateGuardSignerWalletRequest,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
CreateGuardSignerWalletRequestOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &CreateGuardSignerWalletRequestView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::CreateGuardSignerWalletRequest,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn subaccount_id(&self) -> u64 {
self.0.reborrow().subaccount_id
}
}
impl ::core::convert::From<
::buffa::OwnedView<CreateGuardSignerWalletRequestView<'static>>,
> for CreateGuardSignerWalletRequestOwnedView {
fn from(
inner: ::buffa::OwnedView<CreateGuardSignerWalletRequestView<'static>>,
) -> Self {
CreateGuardSignerWalletRequestOwnedView(inner)
}
}
impl ::core::convert::From<CreateGuardSignerWalletRequestOwnedView>
for ::buffa::OwnedView<CreateGuardSignerWalletRequestView<'static>> {
fn from(wrapper: CreateGuardSignerWalletRequestOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<CreateGuardSignerWalletRequestView<'static>>,
> for CreateGuardSignerWalletRequestOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<CreateGuardSignerWalletRequestView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::CreateGuardSignerWalletRequest {
type View<'a> = CreateGuardSignerWalletRequestView<'a>;
type ViewHandle = CreateGuardSignerWalletRequestOwnedView;
}
impl ::serde::Serialize for CreateGuardSignerWalletRequestOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct CreateGuardSignerWalletResponseView<'a> {
pub signer_address: &'a str,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for CreateGuardSignerWalletResponseView<'a> {
type Owned = super::super::CreateGuardSignerWalletResponse;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.signer_address = ::buffa::types::borrow_str(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::CreateGuardSignerWalletResponse,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::CreateGuardSignerWalletResponse,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::CreateGuardSignerWalletResponse {
signer_address: self.signer_address.to_string(),
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for CreateGuardSignerWalletResponseView<'a> {
#[allow(clippy::needless_borrow, 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.signer_address.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.signer_address)
as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.signer_address.is_empty() {
::buffa::types::put_string_field(1u32, &self.signer_address, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for CreateGuardSignerWalletResponseView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_empty_str(self.signer_address) {
__map.serialize_entry("signerAddress", self.signer_address)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for CreateGuardSignerWalletResponseView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "CreateGuardSignerWalletResponse";
const FULL_NAME: &'static str = "chain.guard.v1.CreateGuardSignerWalletResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.CreateGuardSignerWalletResponse";
}
::buffa::impl_default_view_instance!(CreateGuardSignerWalletResponseView);
::buffa::impl_view_reborrow!(CreateGuardSignerWalletResponseView);
#[derive(Clone, Debug)]
pub struct CreateGuardSignerWalletResponseOwnedView(
::buffa::OwnedView<CreateGuardSignerWalletResponseView<'static>>,
);
impl CreateGuardSignerWalletResponseOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
CreateGuardSignerWalletResponseOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
CreateGuardSignerWalletResponseOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::CreateGuardSignerWalletResponse,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
CreateGuardSignerWalletResponseOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &CreateGuardSignerWalletResponseView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::CreateGuardSignerWalletResponse,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn signer_address(&self) -> &'_ str {
self.0.reborrow().signer_address
}
}
impl ::core::convert::From<
::buffa::OwnedView<CreateGuardSignerWalletResponseView<'static>>,
> for CreateGuardSignerWalletResponseOwnedView {
fn from(
inner: ::buffa::OwnedView<CreateGuardSignerWalletResponseView<'static>>,
) -> Self {
CreateGuardSignerWalletResponseOwnedView(inner)
}
}
impl ::core::convert::From<CreateGuardSignerWalletResponseOwnedView>
for ::buffa::OwnedView<CreateGuardSignerWalletResponseView<'static>> {
fn from(wrapper: CreateGuardSignerWalletResponseOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<CreateGuardSignerWalletResponseView<'static>>,
> for CreateGuardSignerWalletResponseOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<CreateGuardSignerWalletResponseView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::CreateGuardSignerWalletResponse {
type View<'a> = CreateGuardSignerWalletResponseView<'a>;
type ViewHandle = CreateGuardSignerWalletResponseOwnedView;
}
impl ::serde::Serialize for CreateGuardSignerWalletResponseOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct GetGuardSignerStatusRequestView<'a> {
pub subaccount_id: u64,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for GetGuardSignerStatusRequestView<'a> {
type Owned = super::super::GetGuardSignerStatusRequest;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Fixed64,
)?;
view.subaccount_id = ::buffa::types::decode_fixed64(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::GetGuardSignerStatusRequest,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::GetGuardSignerStatusRequest,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::GetGuardSignerStatusRequest {
subaccount_id: self.subaccount_id,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for GetGuardSignerStatusRequestView<'a> {
#[allow(clippy::needless_borrow, 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.subaccount_id != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.subaccount_id != 0u64 {
::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for GetGuardSignerStatusRequestView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_zero_u64(&self.subaccount_id) {
__map
.serialize_entry(
"subaccountId",
&::buffa::json_helpers::ProtoJson(&self.subaccount_id),
)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for GetGuardSignerStatusRequestView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "GetGuardSignerStatusRequest";
const FULL_NAME: &'static str = "chain.guard.v1.GetGuardSignerStatusRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.GetGuardSignerStatusRequest";
}
::buffa::impl_default_view_instance!(GetGuardSignerStatusRequestView);
::buffa::impl_view_reborrow!(GetGuardSignerStatusRequestView);
#[derive(Clone, Debug)]
pub struct GetGuardSignerStatusRequestOwnedView(
::buffa::OwnedView<GetGuardSignerStatusRequestView<'static>>,
);
impl GetGuardSignerStatusRequestOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetGuardSignerStatusRequestOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetGuardSignerStatusRequestOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::GetGuardSignerStatusRequest,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetGuardSignerStatusRequestOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &GetGuardSignerStatusRequestView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::GetGuardSignerStatusRequest,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn subaccount_id(&self) -> u64 {
self.0.reborrow().subaccount_id
}
}
impl ::core::convert::From<
::buffa::OwnedView<GetGuardSignerStatusRequestView<'static>>,
> for GetGuardSignerStatusRequestOwnedView {
fn from(
inner: ::buffa::OwnedView<GetGuardSignerStatusRequestView<'static>>,
) -> Self {
GetGuardSignerStatusRequestOwnedView(inner)
}
}
impl ::core::convert::From<GetGuardSignerStatusRequestOwnedView>
for ::buffa::OwnedView<GetGuardSignerStatusRequestView<'static>> {
fn from(wrapper: GetGuardSignerStatusRequestOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<GetGuardSignerStatusRequestView<'static>>,
> for GetGuardSignerStatusRequestOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<GetGuardSignerStatusRequestView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::GetGuardSignerStatusRequest {
type View<'a> = GetGuardSignerStatusRequestView<'a>;
type ViewHandle = GetGuardSignerStatusRequestOwnedView;
}
impl ::serde::Serialize for GetGuardSignerStatusRequestOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct GetGuardSignerStatusResponseView<'a> {
pub status: ::buffa::MessageFieldView<
super::super::__buffa::view::GuardSignerStatusView<'a>,
>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for GetGuardSignerStatusResponseView<'a> {
type Owned = super::super::GetGuardSignerStatusResponse;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
match view.status.as_mut() {
Some(existing) => {
::buffa::MessageView::merge_into_view(
existing,
sub,
__sub_ctx,
)?
}
None => {
view.status = ::buffa::MessageFieldView::set(
<super::super::__buffa::view::GuardSignerStatusView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
);
}
}
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::GetGuardSignerStatusResponse,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::GetGuardSignerStatusResponse,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::GetGuardSignerStatusResponse {
status: match self.status.as_option() {
Some(v) => {
::buffa::MessageField::<
super::super::GuardSignerStatus,
>::some(v.to_owned_from_source(__buffa_src)?)
}
None => ::buffa::MessageField::none(),
},
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for GetGuardSignerStatusResponseView<'a> {
#[allow(clippy::needless_borrow, 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.status.is_set() {
let __slot = __cache.reserve();
let inner_size = self.status.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.status.is_set() {
::buffa::types::put_len_delimited_header(
1u32,
__cache.consume_next(),
buf,
);
self.status.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for GetGuardSignerStatusResponseView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
{
if let ::core::option::Option::Some(__v) = self.status.as_option() {
__map.serialize_entry("status", __v)?;
}
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for GetGuardSignerStatusResponseView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "GetGuardSignerStatusResponse";
const FULL_NAME: &'static str = "chain.guard.v1.GetGuardSignerStatusResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.GetGuardSignerStatusResponse";
}
::buffa::impl_default_view_instance!(GetGuardSignerStatusResponseView);
::buffa::impl_view_reborrow!(GetGuardSignerStatusResponseView);
#[derive(Clone, Debug)]
pub struct GetGuardSignerStatusResponseOwnedView(
::buffa::OwnedView<GetGuardSignerStatusResponseView<'static>>,
);
impl GetGuardSignerStatusResponseOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetGuardSignerStatusResponseOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetGuardSignerStatusResponseOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::GetGuardSignerStatusResponse,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetGuardSignerStatusResponseOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &GetGuardSignerStatusResponseView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::GetGuardSignerStatusResponse,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn status(
&self,
) -> &::buffa::MessageFieldView<
super::super::__buffa::view::GuardSignerStatusView<'_>,
> {
&self.0.reborrow().status
}
}
impl ::core::convert::From<
::buffa::OwnedView<GetGuardSignerStatusResponseView<'static>>,
> for GetGuardSignerStatusResponseOwnedView {
fn from(
inner: ::buffa::OwnedView<GetGuardSignerStatusResponseView<'static>>,
) -> Self {
GetGuardSignerStatusResponseOwnedView(inner)
}
}
impl ::core::convert::From<GetGuardSignerStatusResponseOwnedView>
for ::buffa::OwnedView<GetGuardSignerStatusResponseView<'static>> {
fn from(wrapper: GetGuardSignerStatusResponseOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<GetGuardSignerStatusResponseView<'static>>,
> for GetGuardSignerStatusResponseOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<GetGuardSignerStatusResponseView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::GetGuardSignerStatusResponse {
type View<'a> = GetGuardSignerStatusResponseView<'a>;
type ViewHandle = GetGuardSignerStatusResponseOwnedView;
}
impl ::serde::Serialize for GetGuardSignerStatusResponseOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct SignProtectedActionRequestView<'a> {
pub subaccount_id: u64,
pub action: ::buffa::EnumValue<super::super::ProtectedAction>,
pub args: ::buffa::MessageFieldView<
super::super::__buffa::view::ProtectedActionArgsView<'a>,
>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for SignProtectedActionRequestView<'a> {
type Owned = super::super::SignProtectedActionRequest;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Fixed64,
)?;
view.subaccount_id = ::buffa::types::decode_fixed64(&mut cur)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.action = ::buffa::EnumValue::from(
::buffa::types::decode_int32(&mut cur)?,
);
}
3u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
match view.args.as_mut() {
Some(existing) => {
::buffa::MessageView::merge_into_view(
existing,
sub,
__sub_ctx,
)?
}
None => {
view.args = ::buffa::MessageFieldView::set(
<super::super::__buffa::view::ProtectedActionArgsView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
);
}
}
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::SignProtectedActionRequest,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::SignProtectedActionRequest,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::SignProtectedActionRequest {
subaccount_id: self.subaccount_id,
action: self.action,
args: match self.args.as_option() {
Some(v) => {
::buffa::MessageField::<
super::super::ProtectedActionArgs,
>::some(v.to_owned_from_source(__buffa_src)?)
}
None => ::buffa::MessageField::none(),
},
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for SignProtectedActionRequestView<'a> {
#[allow(clippy::needless_borrow, 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.subaccount_id != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
{
let val = self.action.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.args.is_set() {
let __slot = __cache.reserve();
let inner_size = self.args.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.subaccount_id != 0u64 {
::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
}
{
let val = self.action.to_i32();
if val != 0 {
::buffa::types::put_int32_field(2u32, val, buf);
}
}
if self.args.is_set() {
::buffa::types::put_len_delimited_header(
3u32,
__cache.consume_next(),
buf,
);
self.args.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for SignProtectedActionRequestView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_zero_u64(&self.subaccount_id) {
__map
.serialize_entry(
"subaccountId",
&::buffa::json_helpers::ProtoJson(&self.subaccount_id),
)?;
}
if !::buffa::json_helpers::skip_if::is_default_enum_value(&self.action) {
__map.serialize_entry("action", &self.action)?;
}
{
if let ::core::option::Option::Some(__v) = self.args.as_option() {
__map.serialize_entry("args", __v)?;
}
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for SignProtectedActionRequestView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "SignProtectedActionRequest";
const FULL_NAME: &'static str = "chain.guard.v1.SignProtectedActionRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.SignProtectedActionRequest";
}
::buffa::impl_default_view_instance!(SignProtectedActionRequestView);
::buffa::impl_view_reborrow!(SignProtectedActionRequestView);
#[derive(Clone, Debug)]
pub struct SignProtectedActionRequestOwnedView(
::buffa::OwnedView<SignProtectedActionRequestView<'static>>,
);
impl SignProtectedActionRequestOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
SignProtectedActionRequestOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
SignProtectedActionRequestOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::SignProtectedActionRequest,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
SignProtectedActionRequestOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &SignProtectedActionRequestView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::SignProtectedActionRequest,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn subaccount_id(&self) -> u64 {
self.0.reborrow().subaccount_id
}
#[must_use]
pub fn action(&self) -> ::buffa::EnumValue<super::super::ProtectedAction> {
self.0.reborrow().action
}
#[must_use]
pub fn args(
&self,
) -> &::buffa::MessageFieldView<
super::super::__buffa::view::ProtectedActionArgsView<'_>,
> {
&self.0.reborrow().args
}
}
impl ::core::convert::From<
::buffa::OwnedView<SignProtectedActionRequestView<'static>>,
> for SignProtectedActionRequestOwnedView {
fn from(
inner: ::buffa::OwnedView<SignProtectedActionRequestView<'static>>,
) -> Self {
SignProtectedActionRequestOwnedView(inner)
}
}
impl ::core::convert::From<SignProtectedActionRequestOwnedView>
for ::buffa::OwnedView<SignProtectedActionRequestView<'static>> {
fn from(wrapper: SignProtectedActionRequestOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<SignProtectedActionRequestView<'static>>,
> for SignProtectedActionRequestOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<SignProtectedActionRequestView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::SignProtectedActionRequest {
type View<'a> = SignProtectedActionRequestView<'a>;
type ViewHandle = SignProtectedActionRequestOwnedView;
}
impl ::serde::Serialize for SignProtectedActionRequestOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct SignProtectedActionResponseView<'a> {
pub approval: ::buffa::MessageFieldView<
super::super::__buffa::view::GuardApprovalView<'a>,
>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for SignProtectedActionResponseView<'a> {
type Owned = super::super::SignProtectedActionResponse;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
match view.approval.as_mut() {
Some(existing) => {
::buffa::MessageView::merge_into_view(
existing,
sub,
__sub_ctx,
)?
}
None => {
view.approval = ::buffa::MessageFieldView::set(
<super::super::__buffa::view::GuardApprovalView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
);
}
}
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::SignProtectedActionResponse,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::SignProtectedActionResponse,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::SignProtectedActionResponse {
approval: match self.approval.as_option() {
Some(v) => {
::buffa::MessageField::<
super::super::GuardApproval,
>::some(v.to_owned_from_source(__buffa_src)?)
}
None => ::buffa::MessageField::none(),
},
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for SignProtectedActionResponseView<'a> {
#[allow(clippy::needless_borrow, 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.approval.is_set() {
let __slot = __cache.reserve();
let inner_size = self.approval.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.approval.is_set() {
::buffa::types::put_len_delimited_header(
1u32,
__cache.consume_next(),
buf,
);
self.approval.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for SignProtectedActionResponseView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
{
if let ::core::option::Option::Some(__v) = self.approval.as_option()
{
__map.serialize_entry("approval", __v)?;
}
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for SignProtectedActionResponseView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "SignProtectedActionResponse";
const FULL_NAME: &'static str = "chain.guard.v1.SignProtectedActionResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.SignProtectedActionResponse";
}
::buffa::impl_default_view_instance!(SignProtectedActionResponseView);
::buffa::impl_view_reborrow!(SignProtectedActionResponseView);
#[derive(Clone, Debug)]
pub struct SignProtectedActionResponseOwnedView(
::buffa::OwnedView<SignProtectedActionResponseView<'static>>,
);
impl SignProtectedActionResponseOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
SignProtectedActionResponseOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
SignProtectedActionResponseOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::SignProtectedActionResponse,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
SignProtectedActionResponseOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &SignProtectedActionResponseView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::SignProtectedActionResponse,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn approval(
&self,
) -> &::buffa::MessageFieldView<
super::super::__buffa::view::GuardApprovalView<'_>,
> {
&self.0.reborrow().approval
}
}
impl ::core::convert::From<
::buffa::OwnedView<SignProtectedActionResponseView<'static>>,
> for SignProtectedActionResponseOwnedView {
fn from(
inner: ::buffa::OwnedView<SignProtectedActionResponseView<'static>>,
) -> Self {
SignProtectedActionResponseOwnedView(inner)
}
}
impl ::core::convert::From<SignProtectedActionResponseOwnedView>
for ::buffa::OwnedView<SignProtectedActionResponseView<'static>> {
fn from(wrapper: SignProtectedActionResponseOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<SignProtectedActionResponseView<'static>>,
> for SignProtectedActionResponseOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<SignProtectedActionResponseView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::SignProtectedActionResponse {
type View<'a> = SignProtectedActionResponseView<'a>;
type ViewHandle = SignProtectedActionResponseOwnedView;
}
impl ::serde::Serialize for SignProtectedActionResponseOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct BatchSignProtectedActionItemView<'a> {
pub action: ::buffa::EnumValue<super::super::ProtectedAction>,
pub args: ::buffa::MessageFieldView<
super::super::__buffa::view::ProtectedActionArgsView<'a>,
>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for BatchSignProtectedActionItemView<'a> {
type Owned = super::super::BatchSignProtectedActionItem;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Varint,
)?;
view.action = ::buffa::EnumValue::from(
::buffa::types::decode_int32(&mut cur)?,
);
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
match view.args.as_mut() {
Some(existing) => {
::buffa::MessageView::merge_into_view(
existing,
sub,
__sub_ctx,
)?
}
None => {
view.args = ::buffa::MessageFieldView::set(
<super::super::__buffa::view::ProtectedActionArgsView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
);
}
}
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::BatchSignProtectedActionItem,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::BatchSignProtectedActionItem,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::BatchSignProtectedActionItem {
action: self.action,
args: match self.args.as_option() {
Some(v) => {
::buffa::MessageField::<
super::super::ProtectedActionArgs,
>::some(v.to_owned_from_source(__buffa_src)?)
}
None => ::buffa::MessageField::none(),
},
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for BatchSignProtectedActionItemView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
{
let val = self.action.to_i32();
if val != 0 {
size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
}
}
if self.args.is_set() {
let __slot = __cache.reserve();
let inner_size = self.args.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
{
let val = self.action.to_i32();
if val != 0 {
::buffa::types::put_int32_field(1u32, val, buf);
}
}
if self.args.is_set() {
::buffa::types::put_len_delimited_header(
2u32,
__cache.consume_next(),
buf,
);
self.args.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for BatchSignProtectedActionItemView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_default_enum_value(&self.action) {
__map.serialize_entry("action", &self.action)?;
}
{
if let ::core::option::Option::Some(__v) = self.args.as_option() {
__map.serialize_entry("args", __v)?;
}
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for BatchSignProtectedActionItemView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "BatchSignProtectedActionItem";
const FULL_NAME: &'static str = "chain.guard.v1.BatchSignProtectedActionItem";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.BatchSignProtectedActionItem";
}
::buffa::impl_default_view_instance!(BatchSignProtectedActionItemView);
::buffa::impl_view_reborrow!(BatchSignProtectedActionItemView);
#[derive(Clone, Debug)]
pub struct BatchSignProtectedActionItemOwnedView(
::buffa::OwnedView<BatchSignProtectedActionItemView<'static>>,
);
impl BatchSignProtectedActionItemOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
BatchSignProtectedActionItemOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
BatchSignProtectedActionItemOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::BatchSignProtectedActionItem,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
BatchSignProtectedActionItemOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &BatchSignProtectedActionItemView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::BatchSignProtectedActionItem,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn action(&self) -> ::buffa::EnumValue<super::super::ProtectedAction> {
self.0.reborrow().action
}
#[must_use]
pub fn args(
&self,
) -> &::buffa::MessageFieldView<
super::super::__buffa::view::ProtectedActionArgsView<'_>,
> {
&self.0.reborrow().args
}
}
impl ::core::convert::From<
::buffa::OwnedView<BatchSignProtectedActionItemView<'static>>,
> for BatchSignProtectedActionItemOwnedView {
fn from(
inner: ::buffa::OwnedView<BatchSignProtectedActionItemView<'static>>,
) -> Self {
BatchSignProtectedActionItemOwnedView(inner)
}
}
impl ::core::convert::From<BatchSignProtectedActionItemOwnedView>
for ::buffa::OwnedView<BatchSignProtectedActionItemView<'static>> {
fn from(wrapper: BatchSignProtectedActionItemOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<BatchSignProtectedActionItemView<'static>>,
> for BatchSignProtectedActionItemOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<BatchSignProtectedActionItemView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::BatchSignProtectedActionItem {
type View<'a> = BatchSignProtectedActionItemView<'a>;
type ViewHandle = BatchSignProtectedActionItemOwnedView;
}
impl ::serde::Serialize for BatchSignProtectedActionItemOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct BatchSignProtectedActionsRequestView<'a> {
pub subaccount_id: u64,
pub actions: ::buffa::RepeatedView<
'a,
super::super::__buffa::view::BatchSignProtectedActionItemView<'a>,
>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for BatchSignProtectedActionsRequestView<'a> {
type Owned = super::super::BatchSignProtectedActionsRequest;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Fixed64,
)?;
view.subaccount_id = ::buffa::types::decode_fixed64(&mut cur)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
view.actions
.push(
<super::super::__buffa::view::BatchSignProtectedActionItemView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::BatchSignProtectedActionsRequest,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::BatchSignProtectedActionsRequest,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::BatchSignProtectedActionsRequest {
subaccount_id: self.subaccount_id,
actions: self
.actions
.iter()
.map(|v| v.to_owned_from_source(__buffa_src))
.collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for BatchSignProtectedActionsRequestView<'a> {
#[allow(clippy::needless_borrow, 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.subaccount_id != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
for v in &self.actions {
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 += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.subaccount_id != 0u64 {
::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
}
for v in &self.actions {
::buffa::types::put_len_delimited_header(
2u32,
__cache.consume_next(),
buf,
);
v.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for BatchSignProtectedActionsRequestView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_zero_u64(&self.subaccount_id) {
__map
.serialize_entry(
"subaccountId",
&::buffa::json_helpers::ProtoJson(&self.subaccount_id),
)?;
}
if !self.actions.is_empty() {
__map.serialize_entry("actions", &*self.actions)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for BatchSignProtectedActionsRequestView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "BatchSignProtectedActionsRequest";
const FULL_NAME: &'static str = "chain.guard.v1.BatchSignProtectedActionsRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.BatchSignProtectedActionsRequest";
}
::buffa::impl_default_view_instance!(BatchSignProtectedActionsRequestView);
::buffa::impl_view_reborrow!(BatchSignProtectedActionsRequestView);
#[derive(Clone, Debug)]
pub struct BatchSignProtectedActionsRequestOwnedView(
::buffa::OwnedView<BatchSignProtectedActionsRequestView<'static>>,
);
impl BatchSignProtectedActionsRequestOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
BatchSignProtectedActionsRequestOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
BatchSignProtectedActionsRequestOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::BatchSignProtectedActionsRequest,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
BatchSignProtectedActionsRequestOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &BatchSignProtectedActionsRequestView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::BatchSignProtectedActionsRequest,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn subaccount_id(&self) -> u64 {
self.0.reborrow().subaccount_id
}
#[must_use]
pub fn actions(
&self,
) -> &::buffa::RepeatedView<
'_,
super::super::__buffa::view::BatchSignProtectedActionItemView<'_>,
> {
&self.0.reborrow().actions
}
}
impl ::core::convert::From<
::buffa::OwnedView<BatchSignProtectedActionsRequestView<'static>>,
> for BatchSignProtectedActionsRequestOwnedView {
fn from(
inner: ::buffa::OwnedView<BatchSignProtectedActionsRequestView<'static>>,
) -> Self {
BatchSignProtectedActionsRequestOwnedView(inner)
}
}
impl ::core::convert::From<BatchSignProtectedActionsRequestOwnedView>
for ::buffa::OwnedView<BatchSignProtectedActionsRequestView<'static>> {
fn from(wrapper: BatchSignProtectedActionsRequestOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<BatchSignProtectedActionsRequestView<'static>>,
> for BatchSignProtectedActionsRequestOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<BatchSignProtectedActionsRequestView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::BatchSignProtectedActionsRequest {
type View<'a> = BatchSignProtectedActionsRequestView<'a>;
type ViewHandle = BatchSignProtectedActionsRequestOwnedView;
}
impl ::serde::Serialize for BatchSignProtectedActionsRequestOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct BatchSignProtectedActionsResponseView<'a> {
pub approvals: ::buffa::RepeatedView<
'a,
super::super::__buffa::view::GuardApprovalView<'a>,
>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for BatchSignProtectedActionsResponseView<'a> {
type Owned = super::super::BatchSignProtectedActionsResponse;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
view.approvals
.push(
<super::super::__buffa::view::GuardApprovalView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::BatchSignProtectedActionsResponse,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::BatchSignProtectedActionsResponse,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::BatchSignProtectedActionsResponse {
approvals: self
.approvals
.iter()
.map(|v| v.to_owned_from_source(__buffa_src))
.collect::<::core::result::Result<_, ::buffa::DecodeError>>()?,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for BatchSignProtectedActionsResponseView<'a> {
#[allow(clippy::needless_borrow, 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.approvals {
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 += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
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.approvals {
::buffa::types::put_len_delimited_header(
1u32,
__cache.consume_next(),
buf,
);
v.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for BatchSignProtectedActionsResponseView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !self.approvals.is_empty() {
__map.serialize_entry("approvals", &*self.approvals)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for BatchSignProtectedActionsResponseView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "BatchSignProtectedActionsResponse";
const FULL_NAME: &'static str = "chain.guard.v1.BatchSignProtectedActionsResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.BatchSignProtectedActionsResponse";
}
::buffa::impl_default_view_instance!(BatchSignProtectedActionsResponseView);
::buffa::impl_view_reborrow!(BatchSignProtectedActionsResponseView);
#[derive(Clone, Debug)]
pub struct BatchSignProtectedActionsResponseOwnedView(
::buffa::OwnedView<BatchSignProtectedActionsResponseView<'static>>,
);
impl BatchSignProtectedActionsResponseOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
BatchSignProtectedActionsResponseOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
BatchSignProtectedActionsResponseOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::BatchSignProtectedActionsResponse,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
BatchSignProtectedActionsResponseOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &BatchSignProtectedActionsResponseView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::BatchSignProtectedActionsResponse,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn approvals(
&self,
) -> &::buffa::RepeatedView<
'_,
super::super::__buffa::view::GuardApprovalView<'_>,
> {
&self.0.reborrow().approvals
}
}
impl ::core::convert::From<
::buffa::OwnedView<BatchSignProtectedActionsResponseView<'static>>,
> for BatchSignProtectedActionsResponseOwnedView {
fn from(
inner: ::buffa::OwnedView<BatchSignProtectedActionsResponseView<'static>>,
) -> Self {
BatchSignProtectedActionsResponseOwnedView(inner)
}
}
impl ::core::convert::From<BatchSignProtectedActionsResponseOwnedView>
for ::buffa::OwnedView<BatchSignProtectedActionsResponseView<'static>> {
fn from(wrapper: BatchSignProtectedActionsResponseOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<BatchSignProtectedActionsResponseView<'static>>,
> for BatchSignProtectedActionsResponseOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<BatchSignProtectedActionsResponseView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView
for super::super::BatchSignProtectedActionsResponse {
type View<'a> = BatchSignProtectedActionsResponseView<'a>;
type ViewHandle = BatchSignProtectedActionsResponseOwnedView;
}
impl ::serde::Serialize for BatchSignProtectedActionsResponseOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct RotateGuardSignerWalletRequestView<'a> {
pub subaccount_id: u64,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for RotateGuardSignerWalletRequestView<'a> {
type Owned = super::super::RotateGuardSignerWalletRequest;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Fixed64,
)?;
view.subaccount_id = ::buffa::types::decode_fixed64(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::RotateGuardSignerWalletRequest,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::RotateGuardSignerWalletRequest,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::RotateGuardSignerWalletRequest {
subaccount_id: self.subaccount_id,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for RotateGuardSignerWalletRequestView<'a> {
#[allow(clippy::needless_borrow, 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.subaccount_id != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.subaccount_id != 0u64 {
::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for RotateGuardSignerWalletRequestView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_zero_u64(&self.subaccount_id) {
__map
.serialize_entry(
"subaccountId",
&::buffa::json_helpers::ProtoJson(&self.subaccount_id),
)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for RotateGuardSignerWalletRequestView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "RotateGuardSignerWalletRequest";
const FULL_NAME: &'static str = "chain.guard.v1.RotateGuardSignerWalletRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.RotateGuardSignerWalletRequest";
}
::buffa::impl_default_view_instance!(RotateGuardSignerWalletRequestView);
::buffa::impl_view_reborrow!(RotateGuardSignerWalletRequestView);
#[derive(Clone, Debug)]
pub struct RotateGuardSignerWalletRequestOwnedView(
::buffa::OwnedView<RotateGuardSignerWalletRequestView<'static>>,
);
impl RotateGuardSignerWalletRequestOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
RotateGuardSignerWalletRequestOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
RotateGuardSignerWalletRequestOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::RotateGuardSignerWalletRequest,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
RotateGuardSignerWalletRequestOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &RotateGuardSignerWalletRequestView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::RotateGuardSignerWalletRequest,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn subaccount_id(&self) -> u64 {
self.0.reborrow().subaccount_id
}
}
impl ::core::convert::From<
::buffa::OwnedView<RotateGuardSignerWalletRequestView<'static>>,
> for RotateGuardSignerWalletRequestOwnedView {
fn from(
inner: ::buffa::OwnedView<RotateGuardSignerWalletRequestView<'static>>,
) -> Self {
RotateGuardSignerWalletRequestOwnedView(inner)
}
}
impl ::core::convert::From<RotateGuardSignerWalletRequestOwnedView>
for ::buffa::OwnedView<RotateGuardSignerWalletRequestView<'static>> {
fn from(wrapper: RotateGuardSignerWalletRequestOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<RotateGuardSignerWalletRequestView<'static>>,
> for RotateGuardSignerWalletRequestOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<RotateGuardSignerWalletRequestView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::RotateGuardSignerWalletRequest {
type View<'a> = RotateGuardSignerWalletRequestView<'a>;
type ViewHandle = RotateGuardSignerWalletRequestOwnedView;
}
impl ::serde::Serialize for RotateGuardSignerWalletRequestOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct RotateGuardSignerWalletResponseView<'a> {
pub new_signer_address: &'a str,
pub approval: ::buffa::MessageFieldView<
super::super::__buffa::view::GuardApprovalView<'a>,
>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for RotateGuardSignerWalletResponseView<'a> {
type Owned = super::super::RotateGuardSignerWalletResponse;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.new_signer_address = ::buffa::types::borrow_str(&mut cur)?;
}
2u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
let __sub_ctx = ctx.descend()?;
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
match view.approval.as_mut() {
Some(existing) => {
::buffa::MessageView::merge_into_view(
existing,
sub,
__sub_ctx,
)?
}
None => {
view.approval = ::buffa::MessageFieldView::set(
<super::super::__buffa::view::GuardApprovalView as ::buffa::MessageView>::decode_view_ctx(
sub,
__sub_ctx,
)?,
);
}
}
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::RotateGuardSignerWalletResponse,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::RotateGuardSignerWalletResponse,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::RotateGuardSignerWalletResponse {
new_signer_address: self.new_signer_address.to_string(),
approval: match self.approval.as_option() {
Some(v) => {
::buffa::MessageField::<
super::super::GuardApproval,
>::some(v.to_owned_from_source(__buffa_src)?)
}
None => ::buffa::MessageField::none(),
},
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for RotateGuardSignerWalletResponseView<'a> {
#[allow(clippy::needless_borrow, 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.new_signer_address.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(
&self.new_signer_address,
) as u32;
}
if self.approval.is_set() {
let __slot = __cache.reserve();
let inner_size = self.approval.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.new_signer_address.is_empty() {
::buffa::types::put_string_field(
1u32,
&self.new_signer_address,
buf,
);
}
if self.approval.is_set() {
::buffa::types::put_len_delimited_header(
2u32,
__cache.consume_next(),
buf,
);
self.approval.write_to(__cache, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for RotateGuardSignerWalletResponseView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_empty_str(
self.new_signer_address,
) {
__map.serialize_entry("newSignerAddress", self.new_signer_address)?;
}
{
if let ::core::option::Option::Some(__v) = self.approval.as_option()
{
__map.serialize_entry("approval", __v)?;
}
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for RotateGuardSignerWalletResponseView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "RotateGuardSignerWalletResponse";
const FULL_NAME: &'static str = "chain.guard.v1.RotateGuardSignerWalletResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.RotateGuardSignerWalletResponse";
}
::buffa::impl_default_view_instance!(RotateGuardSignerWalletResponseView);
::buffa::impl_view_reborrow!(RotateGuardSignerWalletResponseView);
#[derive(Clone, Debug)]
pub struct RotateGuardSignerWalletResponseOwnedView(
::buffa::OwnedView<RotateGuardSignerWalletResponseView<'static>>,
);
impl RotateGuardSignerWalletResponseOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
RotateGuardSignerWalletResponseOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
RotateGuardSignerWalletResponseOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::RotateGuardSignerWalletResponse,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
RotateGuardSignerWalletResponseOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &RotateGuardSignerWalletResponseView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::RotateGuardSignerWalletResponse,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn new_signer_address(&self) -> &'_ str {
self.0.reborrow().new_signer_address
}
#[must_use]
pub fn approval(
&self,
) -> &::buffa::MessageFieldView<
super::super::__buffa::view::GuardApprovalView<'_>,
> {
&self.0.reborrow().approval
}
}
impl ::core::convert::From<
::buffa::OwnedView<RotateGuardSignerWalletResponseView<'static>>,
> for RotateGuardSignerWalletResponseOwnedView {
fn from(
inner: ::buffa::OwnedView<RotateGuardSignerWalletResponseView<'static>>,
) -> Self {
RotateGuardSignerWalletResponseOwnedView(inner)
}
}
impl ::core::convert::From<RotateGuardSignerWalletResponseOwnedView>
for ::buffa::OwnedView<RotateGuardSignerWalletResponseView<'static>> {
fn from(wrapper: RotateGuardSignerWalletResponseOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<RotateGuardSignerWalletResponseView<'static>>,
> for RotateGuardSignerWalletResponseOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<RotateGuardSignerWalletResponseView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::RotateGuardSignerWalletResponse {
type View<'a> = RotateGuardSignerWalletResponseView<'a>;
type ViewHandle = RotateGuardSignerWalletResponseOwnedView;
}
impl ::serde::Serialize for RotateGuardSignerWalletResponseOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct ExportGuardSignerWalletRequestView<'a> {
pub subaccount_id: u64,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for ExportGuardSignerWalletRequestView<'a> {
type Owned = super::super::ExportGuardSignerWalletRequest;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::Fixed64,
)?;
view.subaccount_id = ::buffa::types::decode_fixed64(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ExportGuardSignerWalletRequest,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::ExportGuardSignerWalletRequest,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::ExportGuardSignerWalletRequest {
subaccount_id: self.subaccount_id,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for ExportGuardSignerWalletRequestView<'a> {
#[allow(clippy::needless_borrow, 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.subaccount_id != 0u64 {
size += 1u32 + ::buffa::types::FIXED64_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if self.subaccount_id != 0u64 {
::buffa::types::put_fixed64_field(1u32, self.subaccount_id, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for ExportGuardSignerWalletRequestView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_zero_u64(&self.subaccount_id) {
__map
.serialize_entry(
"subaccountId",
&::buffa::json_helpers::ProtoJson(&self.subaccount_id),
)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for ExportGuardSignerWalletRequestView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "ExportGuardSignerWalletRequest";
const FULL_NAME: &'static str = "chain.guard.v1.ExportGuardSignerWalletRequest";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.ExportGuardSignerWalletRequest";
}
::buffa::impl_default_view_instance!(ExportGuardSignerWalletRequestView);
::buffa::impl_view_reborrow!(ExportGuardSignerWalletRequestView);
#[derive(Clone, Debug)]
pub struct ExportGuardSignerWalletRequestOwnedView(
::buffa::OwnedView<ExportGuardSignerWalletRequestView<'static>>,
);
impl ExportGuardSignerWalletRequestOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ExportGuardSignerWalletRequestOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ExportGuardSignerWalletRequestOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::ExportGuardSignerWalletRequest,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ExportGuardSignerWalletRequestOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &ExportGuardSignerWalletRequestView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ExportGuardSignerWalletRequest,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn subaccount_id(&self) -> u64 {
self.0.reborrow().subaccount_id
}
}
impl ::core::convert::From<
::buffa::OwnedView<ExportGuardSignerWalletRequestView<'static>>,
> for ExportGuardSignerWalletRequestOwnedView {
fn from(
inner: ::buffa::OwnedView<ExportGuardSignerWalletRequestView<'static>>,
) -> Self {
ExportGuardSignerWalletRequestOwnedView(inner)
}
}
impl ::core::convert::From<ExportGuardSignerWalletRequestOwnedView>
for ::buffa::OwnedView<ExportGuardSignerWalletRequestView<'static>> {
fn from(wrapper: ExportGuardSignerWalletRequestOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<ExportGuardSignerWalletRequestView<'static>>,
> for ExportGuardSignerWalletRequestOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<ExportGuardSignerWalletRequestView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::ExportGuardSignerWalletRequest {
type View<'a> = ExportGuardSignerWalletRequestView<'a>;
type ViewHandle = ExportGuardSignerWalletRequestOwnedView;
}
impl ::serde::Serialize for ExportGuardSignerWalletRequestOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct ExportGuardSignerWalletResponseView<'a> {
pub private_key: &'a str,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ::buffa::MessageView<'a> for ExportGuardSignerWalletResponseView<'a> {
type Owned = super::super::ExportGuardSignerWalletResponse;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let __limit = ::core::cell::Cell::new(
::buffa::DEFAULT_UNKNOWN_FIELD_LIMIT,
);
<Self as ::buffa::MessageView>::decode_view_ctx(
buf,
::buffa::DecodeContext::new(::buffa::RECURSION_LIMIT, &__limit),
)
}
fn decode_view_with_ctx(
buf: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
<Self as ::buffa::MessageView>::decode_view_ctx(buf, ctx)
}
fn merge_view_field(
&mut self,
tag: ::buffa::encoding::Tag,
cur: &'a [u8],
before_tag: &'a [u8],
ctx: ::buffa::DecodeContext<'_>,
) -> ::core::result::Result<&'a [u8], ::buffa::DecodeError> {
let _ = ctx;
#[allow(unused_variables)]
let view = self;
let mut cur = cur;
match tag.field_number() {
1u32 => {
::buffa::encoding::check_wire_type(
tag,
::buffa::encoding::WireType::LengthDelimited,
)?;
view.private_key = ::buffa::types::borrow_str(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, ctx.depth())?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_record(before_tag, span_len, ctx)?;
}
}
::core::result::Result::Ok(cur)
}
fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ExportGuardSignerWalletResponse,
::buffa::DecodeError,
> {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> ::core::result::Result<
super::super::ExportGuardSignerWalletResponse,
::buffa::DecodeError,
> {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
::core::result::Result::Ok(super::super::ExportGuardSignerWalletResponse {
private_key: self.private_key.to_string(),
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()?
.into(),
..::core::default::Default::default()
})
}
}
impl<'a> ::buffa::ViewEncode<'a> for ExportGuardSignerWalletResponseView<'a> {
#[allow(clippy::needless_borrow, 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.private_key.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.private_key)
as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.private_key.is_empty() {
::buffa::types::put_string_field(1u32, &self.private_key, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for ExportGuardSignerWalletResponseView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_empty_str(self.private_key) {
__map.serialize_entry("privateKey", self.private_key)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for ExportGuardSignerWalletResponseView<'a> {
const PACKAGE: &'static str = "chain.guard.v1";
const NAME: &'static str = "ExportGuardSignerWalletResponse";
const FULL_NAME: &'static str = "chain.guard.v1.ExportGuardSignerWalletResponse";
const TYPE_URL: &'static str = "type.googleapis.com/chain.guard.v1.ExportGuardSignerWalletResponse";
}
::buffa::impl_default_view_instance!(ExportGuardSignerWalletResponseView);
::buffa::impl_view_reborrow!(ExportGuardSignerWalletResponseView);
#[derive(Clone, Debug)]
pub struct ExportGuardSignerWalletResponseOwnedView(
::buffa::OwnedView<ExportGuardSignerWalletResponseView<'static>>,
);
impl ExportGuardSignerWalletResponseOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ExportGuardSignerWalletResponseOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ExportGuardSignerWalletResponseOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::ExportGuardSignerWalletResponse,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ExportGuardSignerWalletResponseOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &ExportGuardSignerWalletResponseView<'_> {
self.0.reborrow()
}
pub fn to_owned_message(
&self,
) -> ::core::result::Result<
super::super::ExportGuardSignerWalletResponse,
::buffa::DecodeError,
> {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn private_key(&self) -> &'_ str {
self.0.reborrow().private_key
}
}
impl ::core::convert::From<
::buffa::OwnedView<ExportGuardSignerWalletResponseView<'static>>,
> for ExportGuardSignerWalletResponseOwnedView {
fn from(
inner: ::buffa::OwnedView<ExportGuardSignerWalletResponseView<'static>>,
) -> Self {
ExportGuardSignerWalletResponseOwnedView(inner)
}
}
impl ::core::convert::From<ExportGuardSignerWalletResponseOwnedView>
for ::buffa::OwnedView<ExportGuardSignerWalletResponseView<'static>> {
fn from(wrapper: ExportGuardSignerWalletResponseOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<ExportGuardSignerWalletResponseView<'static>>,
> for ExportGuardSignerWalletResponseOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<ExportGuardSignerWalletResponseView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::ExportGuardSignerWalletResponse {
type View<'a> = ExportGuardSignerWalletResponseView<'a>;
type ViewHandle = ExportGuardSignerWalletResponseOwnedView;
}
impl ::serde::Serialize for ExportGuardSignerWalletResponseOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
pub mod oneof {
#[allow(unused_imports)]
use super::*;
pub mod protected_action_args {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug)]
pub enum Args<'a> {
ExternalWhitelist(
::buffa::alloc::boxed::Box<
super::super::super::super::__buffa::view::ExternalWhitelistArgsView<
'a,
>,
>,
),
InternalWhitelist(
::buffa::alloc::boxed::Box<
super::super::super::super::__buffa::view::InternalWhitelistArgsView<
'a,
>,
>,
),
WhitelistRequirement(
::buffa::alloc::boxed::Box<
super::super::super::super::__buffa::view::WhitelistRequirementArgsView<
'a,
>,
>,
),
}
}
}
}
pub mod oneof {
#[allow(unused_imports)]
use super::*;
pub mod protected_action_args {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, PartialEq, Debug)]
pub enum Args {
ExternalWhitelist(
::buffa::alloc::boxed::Box<
super::super::super::ExternalWhitelistArgs,
>,
),
InternalWhitelist(
::buffa::alloc::boxed::Box<
super::super::super::InternalWhitelistArgs,
>,
),
WhitelistRequirement(
::buffa::alloc::boxed::Box<
super::super::super::WhitelistRequirementArgs,
>,
),
}
impl ::buffa::Oneof for Args {}
impl From<super::super::super::ExternalWhitelistArgs> for Args {
fn from(v: super::super::super::ExternalWhitelistArgs) -> Self {
Self::ExternalWhitelist(::buffa::alloc::boxed::Box::new(v))
}
}
impl From<super::super::super::ExternalWhitelistArgs>
for ::core::option::Option<Args> {
fn from(v: super::super::super::ExternalWhitelistArgs) -> Self {
Self::Some(Args::from(v))
}
}
impl From<super::super::super::InternalWhitelistArgs> for Args {
fn from(v: super::super::super::InternalWhitelistArgs) -> Self {
Self::InternalWhitelist(::buffa::alloc::boxed::Box::new(v))
}
}
impl From<super::super::super::InternalWhitelistArgs>
for ::core::option::Option<Args> {
fn from(v: super::super::super::InternalWhitelistArgs) -> Self {
Self::Some(Args::from(v))
}
}
impl From<super::super::super::WhitelistRequirementArgs> for Args {
fn from(v: super::super::super::WhitelistRequirementArgs) -> Self {
Self::WhitelistRequirement(::buffa::alloc::boxed::Box::new(v))
}
}
impl From<super::super::super::WhitelistRequirementArgs>
for ::core::option::Option<Args> {
fn from(v: super::super::super::WhitelistRequirementArgs) -> Self {
Self::Some(Args::from(v))
}
}
impl serde::Serialize for Args {
fn serialize<S: serde::Serializer>(
&self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
use serde::ser::SerializeMap;
let mut map = s.serialize_map(Some(1))?;
match self {
Self::ExternalWhitelist(v) => {
map.serialize_entry("externalWhitelist", v)?;
}
Self::InternalWhitelist(v) => {
map.serialize_entry("internalWhitelist", v)?;
}
Self::WhitelistRequirement(v) => {
map.serialize_entry("whitelistRequirement", v)?;
}
}
map.end()
}
}
}
}
pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
reg.register_json_any(super::__GUARD_SIGNER_STATUS_JSON_ANY);
reg.register_json_any(super::__GUARD_APPROVAL_JSON_ANY);
reg.register_json_any(super::__EXTERNAL_WHITELIST_ARGS_JSON_ANY);
reg.register_json_any(super::__INTERNAL_WHITELIST_ARGS_JSON_ANY);
reg.register_json_any(super::__WHITELIST_REQUIREMENT_ARGS_JSON_ANY);
reg.register_json_any(super::__PROTECTED_ACTION_ARGS_JSON_ANY);
reg.register_json_any(super::__CREATE_GUARD_SIGNER_WALLET_REQUEST_JSON_ANY);
reg.register_json_any(super::__CREATE_GUARD_SIGNER_WALLET_RESPONSE_JSON_ANY);
reg.register_json_any(super::__GET_GUARD_SIGNER_STATUS_REQUEST_JSON_ANY);
reg.register_json_any(super::__GET_GUARD_SIGNER_STATUS_RESPONSE_JSON_ANY);
reg.register_json_any(super::__SIGN_PROTECTED_ACTION_REQUEST_JSON_ANY);
reg.register_json_any(super::__SIGN_PROTECTED_ACTION_RESPONSE_JSON_ANY);
reg.register_json_any(super::__BATCH_SIGN_PROTECTED_ACTION_ITEM_JSON_ANY);
reg.register_json_any(super::__BATCH_SIGN_PROTECTED_ACTIONS_REQUEST_JSON_ANY);
reg.register_json_any(super::__BATCH_SIGN_PROTECTED_ACTIONS_RESPONSE_JSON_ANY);
reg.register_json_any(super::__ROTATE_GUARD_SIGNER_WALLET_REQUEST_JSON_ANY);
reg.register_json_any(super::__ROTATE_GUARD_SIGNER_WALLET_RESPONSE_JSON_ANY);
reg.register_json_any(super::__EXPORT_GUARD_SIGNER_WALLET_REQUEST_JSON_ANY);
reg.register_json_any(super::__EXPORT_GUARD_SIGNER_WALLET_RESPONSE_JSON_ANY);
}
}
#[doc(inline)]
pub use self::__buffa::view::GuardSignerStatusView;
#[doc(inline)]
pub use self::__buffa::view::GuardSignerStatusOwnedView;
#[doc(inline)]
pub use self::__buffa::view::GuardApprovalView;
#[doc(inline)]
pub use self::__buffa::view::GuardApprovalOwnedView;
#[doc(inline)]
pub use self::__buffa::view::ExternalWhitelistArgsView;
#[doc(inline)]
pub use self::__buffa::view::ExternalWhitelistArgsOwnedView;
#[doc(inline)]
pub use self::__buffa::view::InternalWhitelistArgsView;
#[doc(inline)]
pub use self::__buffa::view::InternalWhitelistArgsOwnedView;
#[doc(inline)]
pub use self::__buffa::view::WhitelistRequirementArgsView;
#[doc(inline)]
pub use self::__buffa::view::WhitelistRequirementArgsOwnedView;
#[doc(inline)]
pub use self::__buffa::view::ProtectedActionArgsView;
#[doc(inline)]
pub use self::__buffa::view::ProtectedActionArgsOwnedView;
#[doc(inline)]
pub use self::__buffa::view::CreateGuardSignerWalletRequestView;
#[doc(inline)]
pub use self::__buffa::view::CreateGuardSignerWalletRequestOwnedView;
#[doc(inline)]
pub use self::__buffa::view::CreateGuardSignerWalletResponseView;
#[doc(inline)]
pub use self::__buffa::view::CreateGuardSignerWalletResponseOwnedView;
#[doc(inline)]
pub use self::__buffa::view::GetGuardSignerStatusRequestView;
#[doc(inline)]
pub use self::__buffa::view::GetGuardSignerStatusRequestOwnedView;
#[doc(inline)]
pub use self::__buffa::view::GetGuardSignerStatusResponseView;
#[doc(inline)]
pub use self::__buffa::view::GetGuardSignerStatusResponseOwnedView;
#[doc(inline)]
pub use self::__buffa::view::SignProtectedActionRequestView;
#[doc(inline)]
pub use self::__buffa::view::SignProtectedActionRequestOwnedView;
#[doc(inline)]
pub use self::__buffa::view::SignProtectedActionResponseView;
#[doc(inline)]
pub use self::__buffa::view::SignProtectedActionResponseOwnedView;
#[doc(inline)]
pub use self::__buffa::view::BatchSignProtectedActionItemView;
#[doc(inline)]
pub use self::__buffa::view::BatchSignProtectedActionItemOwnedView;
#[doc(inline)]
pub use self::__buffa::view::BatchSignProtectedActionsRequestView;
#[doc(inline)]
pub use self::__buffa::view::BatchSignProtectedActionsRequestOwnedView;
#[doc(inline)]
pub use self::__buffa::view::BatchSignProtectedActionsResponseView;
#[doc(inline)]
pub use self::__buffa::view::BatchSignProtectedActionsResponseOwnedView;
#[doc(inline)]
pub use self::__buffa::view::RotateGuardSignerWalletRequestView;
#[doc(inline)]
pub use self::__buffa::view::RotateGuardSignerWalletRequestOwnedView;
#[doc(inline)]
pub use self::__buffa::view::RotateGuardSignerWalletResponseView;
#[doc(inline)]
pub use self::__buffa::view::RotateGuardSignerWalletResponseOwnedView;
#[doc(inline)]
pub use self::__buffa::view::ExportGuardSignerWalletRequestView;
#[doc(inline)]
pub use self::__buffa::view::ExportGuardSignerWalletRequestOwnedView;
#[doc(inline)]
pub use self::__buffa::view::ExportGuardSignerWalletResponseView;
#[doc(inline)]
pub use self::__buffa::view::ExportGuardSignerWalletResponseOwnedView;
#[doc(inline)]
pub use self::__buffa::register_types;