1#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
4#[repr(i32)]
5pub enum AuthenticationType {
6 AUTHENTICATION_TYPE_UNSPECIFIED = 0i32,
8 TOKEN = 1i32,
10 OAUTH_CLIENT_CREDENTIALS = 2i32,
12}
13impl AuthenticationType {
14 #[allow(non_upper_case_globals)]
16 pub const AuthenticationTypeUnspecified: Self = Self::AUTHENTICATION_TYPE_UNSPECIFIED;
17 #[allow(non_upper_case_globals)]
19 pub const Token: Self = Self::TOKEN;
20 #[allow(non_upper_case_globals)]
22 pub const OauthClientCredentials: Self = Self::OAUTH_CLIENT_CREDENTIALS;
23}
24impl ::core::default::Default for AuthenticationType {
25 fn default() -> Self {
26 Self::AUTHENTICATION_TYPE_UNSPECIFIED
27 }
28}
29impl ::serde::Serialize for AuthenticationType {
30 fn serialize<S: ::serde::Serializer>(
31 &self,
32 s: S,
33 ) -> ::core::result::Result<S::Ok, S::Error> {
34 s.serialize_str(::buffa::Enumeration::proto_name(self))
35 }
36}
37impl<'de> ::serde::Deserialize<'de> for AuthenticationType {
38 fn deserialize<D: ::serde::Deserializer<'de>>(
39 d: D,
40 ) -> ::core::result::Result<Self, D::Error> {
41 struct _V;
42 impl ::serde::de::Visitor<'_> for _V {
43 type Value = AuthenticationType;
44 fn expecting(
45 &self,
46 f: &mut ::core::fmt::Formatter<'_>,
47 ) -> ::core::fmt::Result {
48 f.write_str(
49 concat!(
50 "a string, integer, or null for ", stringify!(AuthenticationType)
51 ),
52 )
53 }
54 fn visit_str<E: ::serde::de::Error>(
55 self,
56 v: &str,
57 ) -> ::core::result::Result<AuthenticationType, E> {
58 <AuthenticationType as ::buffa::Enumeration>::from_proto_name(v)
59 .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
60 }
61 fn visit_i64<E: ::serde::de::Error>(
62 self,
63 v: i64,
64 ) -> ::core::result::Result<AuthenticationType, E> {
65 let v32 = i32::try_from(v)
66 .map_err(|_| {
67 ::serde::de::Error::custom(
68 ::buffa::alloc::format!("enum value {v} out of i32 range"),
69 )
70 })?;
71 <AuthenticationType as ::buffa::Enumeration>::from_i32(v32)
72 .ok_or_else(|| {
73 ::serde::de::Error::custom(
74 ::buffa::alloc::format!("unknown enum value {v32}"),
75 )
76 })
77 }
78 fn visit_u64<E: ::serde::de::Error>(
79 self,
80 v: u64,
81 ) -> ::core::result::Result<AuthenticationType, E> {
82 let v32 = i32::try_from(v)
83 .map_err(|_| {
84 ::serde::de::Error::custom(
85 ::buffa::alloc::format!("enum value {v} out of i32 range"),
86 )
87 })?;
88 <AuthenticationType as ::buffa::Enumeration>::from_i32(v32)
89 .ok_or_else(|| {
90 ::serde::de::Error::custom(
91 ::buffa::alloc::format!("unknown enum value {v32}"),
92 )
93 })
94 }
95 fn visit_unit<E: ::serde::de::Error>(
96 self,
97 ) -> ::core::result::Result<AuthenticationType, E> {
98 ::core::result::Result::Ok(::core::default::Default::default())
99 }
100 }
101 d.deserialize_any(_V)
102 }
103}
104impl ::buffa::json_helpers::ProtoElemJson for AuthenticationType {
105 fn serialize_proto_json<S: ::serde::Serializer>(
106 v: &Self,
107 s: S,
108 ) -> ::core::result::Result<S::Ok, S::Error> {
109 ::serde::Serialize::serialize(v, s)
110 }
111 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
112 d: D,
113 ) -> ::core::result::Result<Self, D::Error> {
114 <Self as ::serde::Deserialize>::deserialize(d)
115 }
116}
117impl ::buffa::Enumeration for AuthenticationType {
118 fn from_i32(value: i32) -> ::core::option::Option<Self> {
119 match value {
120 0i32 => ::core::option::Option::Some(Self::AUTHENTICATION_TYPE_UNSPECIFIED),
121 1i32 => ::core::option::Option::Some(Self::TOKEN),
122 2i32 => ::core::option::Option::Some(Self::OAUTH_CLIENT_CREDENTIALS),
123 _ => ::core::option::Option::None,
124 }
125 }
126 fn to_i32(&self) -> i32 {
127 *self as i32
128 }
129 fn proto_name(&self) -> &'static str {
130 match self {
131 Self::AUTHENTICATION_TYPE_UNSPECIFIED => "AUTHENTICATION_TYPE_UNSPECIFIED",
132 Self::TOKEN => "TOKEN",
133 Self::OAUTH_CLIENT_CREDENTIALS => "OAUTH_CLIENT_CREDENTIALS",
134 }
135 }
136 fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
137 match name {
138 "AUTHENTICATION_TYPE_UNSPECIFIED" => {
139 ::core::option::Option::Some(Self::AUTHENTICATION_TYPE_UNSPECIFIED)
140 }
141 "TOKEN" => ::core::option::Option::Some(Self::TOKEN),
142 "OAUTH_CLIENT_CREDENTIALS" => {
143 ::core::option::Option::Some(Self::OAUTH_CLIENT_CREDENTIALS)
144 }
145 _ => ::core::option::Option::None,
146 }
147 }
148 fn values() -> &'static [Self] {
149 &[
150 Self::AUTHENTICATION_TYPE_UNSPECIFIED,
151 Self::TOKEN,
152 Self::OAUTH_CLIENT_CREDENTIALS,
153 ]
154 }
155}
156#[derive(Clone, PartialEq, Default)]
157#[derive(::serde::Serialize, ::serde::Deserialize)]
158#[serde(default)]
159pub struct RecipientToken {
160 #[serde(
164 rename = "id",
165 with = "::buffa::json_helpers::proto_string",
166 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
167 )]
168 pub id: ::buffa::alloc::string::String,
169 #[serde(
173 rename = "created_at",
174 alias = "createdAt",
175 with = "::buffa::json_helpers::int64",
176 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
177 )]
178 pub created_at: i64,
179 #[serde(
183 rename = "created_by",
184 alias = "createdBy",
185 with = "::buffa::json_helpers::proto_string",
186 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
187 )]
188 pub created_by: ::buffa::alloc::string::String,
189 #[serde(
193 rename = "activation_url",
194 alias = "activationUrl",
195 with = "::buffa::json_helpers::proto_string",
196 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
197 )]
198 pub activation_url: ::buffa::alloc::string::String,
199 #[serde(
203 rename = "expiration_time",
204 alias = "expirationTime",
205 with = "::buffa::json_helpers::int64",
206 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
207 )]
208 pub expiration_time: i64,
209 #[serde(
213 rename = "updated_at",
214 alias = "updatedAt",
215 with = "::buffa::json_helpers::int64",
216 skip_serializing_if = "::buffa::json_helpers::skip_if::is_zero_i64"
217 )]
218 pub updated_at: i64,
219 #[serde(
223 rename = "updated_by",
224 alias = "updatedBy",
225 with = "::buffa::json_helpers::proto_string",
226 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
227 )]
228 pub updated_by: ::buffa::alloc::string::String,
229 #[serde(skip)]
230 #[doc(hidden)]
231 pub __buffa_unknown_fields: ::buffa::UnknownFields,
232}
233impl ::core::fmt::Debug for RecipientToken {
234 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
235 f.debug_struct("RecipientToken")
236 .field("id", &self.id)
237 .field("created_at", &self.created_at)
238 .field("created_by", &self.created_by)
239 .field("activation_url", &self.activation_url)
240 .field("expiration_time", &self.expiration_time)
241 .field("updated_at", &self.updated_at)
242 .field("updated_by", &self.updated_by)
243 .finish()
244 }
245}
246impl RecipientToken {
247 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.RecipientToken";
252}
253impl ::buffa::DefaultInstance for RecipientToken {
254 fn default_instance() -> &'static Self {
255 static VALUE: ::buffa::__private::OnceBox<RecipientToken> = ::buffa::__private::OnceBox::new();
256 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
257 }
258}
259impl ::buffa::MessageName for RecipientToken {
260 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
261 const NAME: &'static str = "RecipientToken";
262 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.RecipientToken";
263 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.RecipientToken";
264}
265impl ::buffa::Message for RecipientToken {
266 #[allow(clippy::let_and_return)]
272 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
273 #[allow(unused_imports)]
274 use ::buffa::Enumeration as _;
275 let mut size = 0u32;
276 if !self.id.is_empty() {
277 size += 1u32 + ::buffa::types::string_encoded_len(&self.id) as u32;
278 }
279 if self.created_at != 0i64 {
280 size += 1u32 + ::buffa::types::int64_encoded_len(self.created_at) as u32;
281 }
282 if !self.created_by.is_empty() {
283 size += 1u32 + ::buffa::types::string_encoded_len(&self.created_by) as u32;
284 }
285 if !self.activation_url.is_empty() {
286 size
287 += 1u32
288 + ::buffa::types::string_encoded_len(&self.activation_url) as u32;
289 }
290 if self.expiration_time != 0i64 {
291 size
292 += 1u32 + ::buffa::types::int64_encoded_len(self.expiration_time) as u32;
293 }
294 if self.updated_at != 0i64 {
295 size += 1u32 + ::buffa::types::int64_encoded_len(self.updated_at) as u32;
296 }
297 if !self.updated_by.is_empty() {
298 size += 1u32 + ::buffa::types::string_encoded_len(&self.updated_by) as u32;
299 }
300 size += self.__buffa_unknown_fields.encoded_len() as u32;
301 size
302 }
303 fn write_to(
304 &self,
305 _cache: &mut ::buffa::SizeCache,
306 buf: &mut impl ::buffa::bytes::BufMut,
307 ) {
308 #[allow(unused_imports)]
309 use ::buffa::Enumeration as _;
310 if !self.id.is_empty() {
311 ::buffa::encoding::Tag::new(
312 1u32,
313 ::buffa::encoding::WireType::LengthDelimited,
314 )
315 .encode(buf);
316 ::buffa::types::encode_string(&self.id, buf);
317 }
318 if self.created_at != 0i64 {
319 ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
320 .encode(buf);
321 ::buffa::types::encode_int64(self.created_at, buf);
322 }
323 if !self.created_by.is_empty() {
324 ::buffa::encoding::Tag::new(
325 3u32,
326 ::buffa::encoding::WireType::LengthDelimited,
327 )
328 .encode(buf);
329 ::buffa::types::encode_string(&self.created_by, buf);
330 }
331 if !self.activation_url.is_empty() {
332 ::buffa::encoding::Tag::new(
333 4u32,
334 ::buffa::encoding::WireType::LengthDelimited,
335 )
336 .encode(buf);
337 ::buffa::types::encode_string(&self.activation_url, buf);
338 }
339 if self.expiration_time != 0i64 {
340 ::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
341 .encode(buf);
342 ::buffa::types::encode_int64(self.expiration_time, buf);
343 }
344 if self.updated_at != 0i64 {
345 ::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
346 .encode(buf);
347 ::buffa::types::encode_int64(self.updated_at, buf);
348 }
349 if !self.updated_by.is_empty() {
350 ::buffa::encoding::Tag::new(
351 7u32,
352 ::buffa::encoding::WireType::LengthDelimited,
353 )
354 .encode(buf);
355 ::buffa::types::encode_string(&self.updated_by, buf);
356 }
357 self.__buffa_unknown_fields.write_to(buf);
358 }
359 fn merge_field(
360 &mut self,
361 tag: ::buffa::encoding::Tag,
362 buf: &mut impl ::buffa::bytes::Buf,
363 depth: u32,
364 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
365 #[allow(unused_imports)]
366 use ::buffa::bytes::Buf as _;
367 #[allow(unused_imports)]
368 use ::buffa::Enumeration as _;
369 match tag.field_number() {
370 1u32 => {
371 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
372 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
373 field_number: 1u32,
374 expected: 2u8,
375 actual: tag.wire_type() as u8,
376 });
377 }
378 ::buffa::types::merge_string(&mut self.id, buf)?;
379 }
380 2u32 => {
381 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
382 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
383 field_number: 2u32,
384 expected: 0u8,
385 actual: tag.wire_type() as u8,
386 });
387 }
388 self.created_at = ::buffa::types::decode_int64(buf)?;
389 }
390 3u32 => {
391 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
392 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
393 field_number: 3u32,
394 expected: 2u8,
395 actual: tag.wire_type() as u8,
396 });
397 }
398 ::buffa::types::merge_string(&mut self.created_by, buf)?;
399 }
400 4u32 => {
401 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
402 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
403 field_number: 4u32,
404 expected: 2u8,
405 actual: tag.wire_type() as u8,
406 });
407 }
408 ::buffa::types::merge_string(&mut self.activation_url, buf)?;
409 }
410 5u32 => {
411 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
412 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
413 field_number: 5u32,
414 expected: 0u8,
415 actual: tag.wire_type() as u8,
416 });
417 }
418 self.expiration_time = ::buffa::types::decode_int64(buf)?;
419 }
420 6u32 => {
421 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
422 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
423 field_number: 6u32,
424 expected: 0u8,
425 actual: tag.wire_type() as u8,
426 });
427 }
428 self.updated_at = ::buffa::types::decode_int64(buf)?;
429 }
430 7u32 => {
431 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
432 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
433 field_number: 7u32,
434 expected: 2u8,
435 actual: tag.wire_type() as u8,
436 });
437 }
438 ::buffa::types::merge_string(&mut self.updated_by, buf)?;
439 }
440 _ => {
441 self.__buffa_unknown_fields
442 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
443 }
444 }
445 ::core::result::Result::Ok(())
446 }
447 fn clear(&mut self) {
448 self.id.clear();
449 self.created_at = 0i64;
450 self.created_by.clear();
451 self.activation_url.clear();
452 self.expiration_time = 0i64;
453 self.updated_at = 0i64;
454 self.updated_by.clear();
455 self.__buffa_unknown_fields.clear();
456 }
457}
458impl ::buffa::ExtensionSet for RecipientToken {
459 const PROTO_FQN: &'static str = "unitycatalog.recipients.v1.RecipientToken";
460 fn unknown_fields(&self) -> &::buffa::UnknownFields {
461 &self.__buffa_unknown_fields
462 }
463 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
464 &mut self.__buffa_unknown_fields
465 }
466}
467impl ::buffa::json_helpers::ProtoElemJson for RecipientToken {
468 fn serialize_proto_json<S: ::serde::Serializer>(
469 v: &Self,
470 s: S,
471 ) -> ::core::result::Result<S::Ok, S::Error> {
472 ::serde::Serialize::serialize(v, s)
473 }
474 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
475 d: D,
476 ) -> ::core::result::Result<Self, D::Error> {
477 <Self as ::serde::Deserialize>::deserialize(d)
478 }
479}
480#[doc(hidden)]
481pub const __RECIPIENT_TOKEN_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
482 type_url: "type.googleapis.com/unitycatalog.recipients.v1.RecipientToken",
483 to_json: ::buffa::type_registry::any_to_json::<RecipientToken>,
484 from_json: ::buffa::type_registry::any_from_json::<RecipientToken>,
485 is_wkt: false,
486};
487#[derive(Clone, PartialEq, Default)]
488#[derive(::serde::Serialize, ::serde::Deserialize)]
489#[serde(default)]
490pub struct Recipient {
491 #[serde(rename = "id", skip_serializing_if = "::core::option::Option::is_none")]
495 pub id: ::core::option::Option<::buffa::alloc::string::String>,
496 #[serde(
500 rename = "name",
501 with = "::buffa::json_helpers::proto_string",
502 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
503 )]
504 pub name: ::buffa::alloc::string::String,
505 #[serde(
509 rename = "authentication_type",
510 alias = "authenticationType",
511 with = "::buffa::json_helpers::proto_enum",
512 skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
513 )]
514 pub authentication_type: ::buffa::EnumValue<AuthenticationType>,
515 #[serde(rename = "owner", skip_serializing_if = "::core::option::Option::is_none")]
519 pub owner: ::core::option::Option<::buffa::alloc::string::String>,
520 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
524 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
525 #[serde(
529 rename = "properties",
530 skip_serializing_if = "::buffa::__private::HashMap::is_empty",
531 deserialize_with = "::buffa::json_helpers::null_as_default"
532 )]
533 pub properties: ::buffa::__private::HashMap<
534 ::buffa::alloc::string::String,
535 ::buffa::alloc::string::String,
536 >,
537 #[serde(
541 rename = "created_at",
542 alias = "createdAt",
543 with = "::buffa::json_helpers::opt_int64",
544 skip_serializing_if = "::core::option::Option::is_none"
545 )]
546 pub created_at: ::core::option::Option<i64>,
547 #[serde(
551 rename = "created_by",
552 alias = "createdBy",
553 skip_serializing_if = "::core::option::Option::is_none"
554 )]
555 pub created_by: ::core::option::Option<::buffa::alloc::string::String>,
556 #[serde(
560 rename = "tokens",
561 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
562 deserialize_with = "::buffa::json_helpers::null_as_default"
563 )]
564 pub tokens: ::buffa::alloc::vec::Vec<RecipientToken>,
565 #[serde(
569 rename = "updated_at",
570 alias = "updatedAt",
571 with = "::buffa::json_helpers::opt_int64",
572 skip_serializing_if = "::core::option::Option::is_none"
573 )]
574 pub updated_at: ::core::option::Option<i64>,
575 #[serde(
579 rename = "updated_by",
580 alias = "updatedBy",
581 skip_serializing_if = "::core::option::Option::is_none"
582 )]
583 pub updated_by: ::core::option::Option<::buffa::alloc::string::String>,
584 #[serde(skip)]
585 #[doc(hidden)]
586 pub __buffa_unknown_fields: ::buffa::UnknownFields,
587}
588impl ::core::fmt::Debug for Recipient {
589 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
590 f.debug_struct("Recipient")
591 .field("id", &self.id)
592 .field("name", &self.name)
593 .field("authentication_type", &self.authentication_type)
594 .field("owner", &self.owner)
595 .field("comment", &self.comment)
596 .field("properties", &self.properties)
597 .field("created_at", &self.created_at)
598 .field("created_by", &self.created_by)
599 .field("tokens", &self.tokens)
600 .field("updated_at", &self.updated_at)
601 .field("updated_by", &self.updated_by)
602 .finish()
603 }
604}
605impl Recipient {
606 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.Recipient";
611}
612impl Recipient {
613 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
614 #[inline]
615 pub fn with_id(mut self, value: impl Into<::buffa::alloc::string::String>) -> Self {
617 self.id = Some(value.into());
618 self
619 }
620 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
621 #[inline]
622 pub fn with_owner(
624 mut self,
625 value: impl Into<::buffa::alloc::string::String>,
626 ) -> Self {
627 self.owner = Some(value.into());
628 self
629 }
630 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
631 #[inline]
632 pub fn with_comment(
634 mut self,
635 value: impl Into<::buffa::alloc::string::String>,
636 ) -> Self {
637 self.comment = Some(value.into());
638 self
639 }
640 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
641 #[inline]
642 pub fn with_created_at(mut self, value: i64) -> Self {
644 self.created_at = Some(value);
645 self
646 }
647 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
648 #[inline]
649 pub fn with_created_by(
651 mut self,
652 value: impl Into<::buffa::alloc::string::String>,
653 ) -> Self {
654 self.created_by = Some(value.into());
655 self
656 }
657 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
658 #[inline]
659 pub fn with_updated_at(mut self, value: i64) -> Self {
661 self.updated_at = Some(value);
662 self
663 }
664 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
665 #[inline]
666 pub fn with_updated_by(
668 mut self,
669 value: impl Into<::buffa::alloc::string::String>,
670 ) -> Self {
671 self.updated_by = Some(value.into());
672 self
673 }
674}
675impl ::buffa::DefaultInstance for Recipient {
676 fn default_instance() -> &'static Self {
677 static VALUE: ::buffa::__private::OnceBox<Recipient> = ::buffa::__private::OnceBox::new();
678 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
679 }
680}
681impl ::buffa::MessageName for Recipient {
682 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
683 const NAME: &'static str = "Recipient";
684 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.Recipient";
685 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.Recipient";
686}
687impl ::buffa::Message for Recipient {
688 #[allow(clippy::let_and_return)]
694 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
695 #[allow(unused_imports)]
696 use ::buffa::Enumeration as _;
697 let mut size = 0u32;
698 if !self.name.is_empty() {
699 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
700 }
701 {
702 let val = self.authentication_type.to_i32();
703 if val != 0 {
704 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
705 }
706 }
707 if let Some(ref v) = self.owner {
708 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
709 }
710 if let Some(ref v) = self.comment {
711 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
712 }
713 #[allow(clippy::for_kv_map)]
714 for (k, v) in &self.properties {
715 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
716 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
717 size
718 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
719 + entry_size;
720 }
721 if let Some(v) = self.created_at {
722 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
723 }
724 if let Some(ref v) = self.created_by {
725 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
726 }
727 for v in &self.tokens {
728 let __slot = __cache.reserve();
729 let inner_size = v.compute_size(__cache);
730 __cache.set(__slot, inner_size);
731 size
732 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
733 + inner_size;
734 }
735 if let Some(v) = self.updated_at {
736 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
737 }
738 if let Some(ref v) = self.updated_by {
739 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
740 }
741 if let Some(ref v) = self.id {
742 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
743 }
744 size += self.__buffa_unknown_fields.encoded_len() as u32;
745 size
746 }
747 fn write_to(
748 &self,
749 __cache: &mut ::buffa::SizeCache,
750 buf: &mut impl ::buffa::bytes::BufMut,
751 ) {
752 #[allow(unused_imports)]
753 use ::buffa::Enumeration as _;
754 if !self.name.is_empty() {
755 ::buffa::encoding::Tag::new(
756 1u32,
757 ::buffa::encoding::WireType::LengthDelimited,
758 )
759 .encode(buf);
760 ::buffa::types::encode_string(&self.name, buf);
761 }
762 {
763 let val = self.authentication_type.to_i32();
764 if val != 0 {
765 ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
766 .encode(buf);
767 ::buffa::types::encode_int32(val, buf);
768 }
769 }
770 if let Some(ref v) = self.owner {
771 ::buffa::encoding::Tag::new(
772 3u32,
773 ::buffa::encoding::WireType::LengthDelimited,
774 )
775 .encode(buf);
776 ::buffa::types::encode_string(v, buf);
777 }
778 if let Some(ref v) = self.comment {
779 ::buffa::encoding::Tag::new(
780 4u32,
781 ::buffa::encoding::WireType::LengthDelimited,
782 )
783 .encode(buf);
784 ::buffa::types::encode_string(v, buf);
785 }
786 for (k, v) in &self.properties {
787 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
788 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
789 ::buffa::encoding::Tag::new(
790 6u32,
791 ::buffa::encoding::WireType::LengthDelimited,
792 )
793 .encode(buf);
794 ::buffa::encoding::encode_varint(entry_size as u64, buf);
795 ::buffa::encoding::Tag::new(
796 1u32,
797 ::buffa::encoding::WireType::LengthDelimited,
798 )
799 .encode(buf);
800 ::buffa::types::encode_string(k, buf);
801 ::buffa::encoding::Tag::new(
802 2u32,
803 ::buffa::encoding::WireType::LengthDelimited,
804 )
805 .encode(buf);
806 ::buffa::types::encode_string(v, buf);
807 }
808 if let Some(v) = self.created_at {
809 ::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
810 .encode(buf);
811 ::buffa::types::encode_int64(v, buf);
812 }
813 if let Some(ref v) = self.created_by {
814 ::buffa::encoding::Tag::new(
815 8u32,
816 ::buffa::encoding::WireType::LengthDelimited,
817 )
818 .encode(buf);
819 ::buffa::types::encode_string(v, buf);
820 }
821 for v in &self.tokens {
822 ::buffa::encoding::Tag::new(
823 9u32,
824 ::buffa::encoding::WireType::LengthDelimited,
825 )
826 .encode(buf);
827 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
828 v.write_to(__cache, buf);
829 }
830 if let Some(v) = self.updated_at {
831 ::buffa::encoding::Tag::new(10u32, ::buffa::encoding::WireType::Varint)
832 .encode(buf);
833 ::buffa::types::encode_int64(v, buf);
834 }
835 if let Some(ref v) = self.updated_by {
836 ::buffa::encoding::Tag::new(
837 11u32,
838 ::buffa::encoding::WireType::LengthDelimited,
839 )
840 .encode(buf);
841 ::buffa::types::encode_string(v, buf);
842 }
843 if let Some(ref v) = self.id {
844 ::buffa::encoding::Tag::new(
845 100u32,
846 ::buffa::encoding::WireType::LengthDelimited,
847 )
848 .encode(buf);
849 ::buffa::types::encode_string(v, buf);
850 }
851 self.__buffa_unknown_fields.write_to(buf);
852 }
853 fn merge_field(
854 &mut self,
855 tag: ::buffa::encoding::Tag,
856 buf: &mut impl ::buffa::bytes::Buf,
857 depth: u32,
858 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
859 #[allow(unused_imports)]
860 use ::buffa::bytes::Buf as _;
861 #[allow(unused_imports)]
862 use ::buffa::Enumeration as _;
863 match tag.field_number() {
864 1u32 => {
865 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
866 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
867 field_number: 1u32,
868 expected: 2u8,
869 actual: tag.wire_type() as u8,
870 });
871 }
872 ::buffa::types::merge_string(&mut self.name, buf)?;
873 }
874 2u32 => {
875 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
876 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
877 field_number: 2u32,
878 expected: 0u8,
879 actual: tag.wire_type() as u8,
880 });
881 }
882 self.authentication_type = ::buffa::EnumValue::from(
883 ::buffa::types::decode_int32(buf)?,
884 );
885 }
886 3u32 => {
887 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
888 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
889 field_number: 3u32,
890 expected: 2u8,
891 actual: tag.wire_type() as u8,
892 });
893 }
894 ::buffa::types::merge_string(
895 self.owner.get_or_insert_with(::buffa::alloc::string::String::new),
896 buf,
897 )?;
898 }
899 4u32 => {
900 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
901 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
902 field_number: 4u32,
903 expected: 2u8,
904 actual: tag.wire_type() as u8,
905 });
906 }
907 ::buffa::types::merge_string(
908 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
909 buf,
910 )?;
911 }
912 6u32 => {
913 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
914 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
915 field_number: 6u32,
916 expected: 2u8,
917 actual: tag.wire_type() as u8,
918 });
919 }
920 let entry_len = ::buffa::encoding::decode_varint(buf)?;
921 let entry_len = usize::try_from(entry_len)
922 .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
923 if buf.remaining() < entry_len {
924 return ::core::result::Result::Err(
925 ::buffa::DecodeError::UnexpectedEof,
926 );
927 }
928 let entry_limit = buf.remaining() - entry_len;
929 let mut key = ::core::default::Default::default();
930 let mut val = ::core::default::Default::default();
931 while buf.remaining() > entry_limit {
932 let entry_tag = ::buffa::encoding::Tag::decode(buf)?;
933 match entry_tag.field_number() {
934 1 => {
935 if entry_tag.wire_type()
936 != ::buffa::encoding::WireType::LengthDelimited
937 {
938 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
939 field_number: entry_tag.field_number(),
940 expected: 2u8,
941 actual: entry_tag.wire_type() as u8,
942 });
943 }
944 key = ::buffa::types::decode_string(buf)?;
945 }
946 2 => {
947 if entry_tag.wire_type()
948 != ::buffa::encoding::WireType::LengthDelimited
949 {
950 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
951 field_number: entry_tag.field_number(),
952 expected: 2u8,
953 actual: entry_tag.wire_type() as u8,
954 });
955 }
956 val = ::buffa::types::decode_string(buf)?;
957 }
958 _ => {
959 ::buffa::encoding::skip_field_depth(entry_tag, buf, depth)?;
960 }
961 }
962 }
963 if buf.remaining() != entry_limit {
964 let remaining = buf.remaining();
965 if remaining > entry_limit {
966 buf.advance(remaining - entry_limit);
967 } else {
968 return ::core::result::Result::Err(
969 ::buffa::DecodeError::UnexpectedEof,
970 );
971 }
972 }
973 self.properties.insert(key, val);
974 }
975 7u32 => {
976 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
977 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
978 field_number: 7u32,
979 expected: 0u8,
980 actual: tag.wire_type() as u8,
981 });
982 }
983 self.created_at = ::core::option::Option::Some(
984 ::buffa::types::decode_int64(buf)?,
985 );
986 }
987 8u32 => {
988 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
989 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
990 field_number: 8u32,
991 expected: 2u8,
992 actual: tag.wire_type() as u8,
993 });
994 }
995 ::buffa::types::merge_string(
996 self
997 .created_by
998 .get_or_insert_with(::buffa::alloc::string::String::new),
999 buf,
1000 )?;
1001 }
1002 9u32 => {
1003 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1004 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1005 field_number: 9u32,
1006 expected: 2u8,
1007 actual: tag.wire_type() as u8,
1008 });
1009 }
1010 let mut elem = ::core::default::Default::default();
1011 ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
1012 self.tokens.push(elem);
1013 }
1014 10u32 => {
1015 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1016 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1017 field_number: 10u32,
1018 expected: 0u8,
1019 actual: tag.wire_type() as u8,
1020 });
1021 }
1022 self.updated_at = ::core::option::Option::Some(
1023 ::buffa::types::decode_int64(buf)?,
1024 );
1025 }
1026 11u32 => {
1027 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1028 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1029 field_number: 11u32,
1030 expected: 2u8,
1031 actual: tag.wire_type() as u8,
1032 });
1033 }
1034 ::buffa::types::merge_string(
1035 self
1036 .updated_by
1037 .get_or_insert_with(::buffa::alloc::string::String::new),
1038 buf,
1039 )?;
1040 }
1041 100u32 => {
1042 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1043 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1044 field_number: 100u32,
1045 expected: 2u8,
1046 actual: tag.wire_type() as u8,
1047 });
1048 }
1049 ::buffa::types::merge_string(
1050 self.id.get_or_insert_with(::buffa::alloc::string::String::new),
1051 buf,
1052 )?;
1053 }
1054 _ => {
1055 self.__buffa_unknown_fields
1056 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1057 }
1058 }
1059 ::core::result::Result::Ok(())
1060 }
1061 fn clear(&mut self) {
1062 self.name.clear();
1063 self.authentication_type = ::buffa::EnumValue::from(0);
1064 self.owner = ::core::option::Option::None;
1065 self.comment = ::core::option::Option::None;
1066 self.properties.clear();
1067 self.created_at = ::core::option::Option::None;
1068 self.created_by = ::core::option::Option::None;
1069 self.tokens.clear();
1070 self.updated_at = ::core::option::Option::None;
1071 self.updated_by = ::core::option::Option::None;
1072 self.id = ::core::option::Option::None;
1073 self.__buffa_unknown_fields.clear();
1074 }
1075}
1076impl ::buffa::ExtensionSet for Recipient {
1077 const PROTO_FQN: &'static str = "unitycatalog.recipients.v1.Recipient";
1078 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1079 &self.__buffa_unknown_fields
1080 }
1081 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1082 &mut self.__buffa_unknown_fields
1083 }
1084}
1085impl ::buffa::json_helpers::ProtoElemJson for Recipient {
1086 fn serialize_proto_json<S: ::serde::Serializer>(
1087 v: &Self,
1088 s: S,
1089 ) -> ::core::result::Result<S::Ok, S::Error> {
1090 ::serde::Serialize::serialize(v, s)
1091 }
1092 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1093 d: D,
1094 ) -> ::core::result::Result<Self, D::Error> {
1095 <Self as ::serde::Deserialize>::deserialize(d)
1096 }
1097}
1098#[doc(hidden)]
1099pub const __RECIPIENT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1100 type_url: "type.googleapis.com/unitycatalog.recipients.v1.Recipient",
1101 to_json: ::buffa::type_registry::any_to_json::<Recipient>,
1102 from_json: ::buffa::type_registry::any_from_json::<Recipient>,
1103 is_wkt: false,
1104};
1105#[derive(Clone, PartialEq, Default)]
1107#[derive(::serde::Serialize, ::serde::Deserialize)]
1108#[serde(default)]
1109pub struct ListRecipientsRequest {
1110 #[serde(
1114 rename = "max_results",
1115 alias = "maxResults",
1116 with = "::buffa::json_helpers::opt_int32",
1117 skip_serializing_if = "::core::option::Option::is_none"
1118 )]
1119 pub max_results: ::core::option::Option<i32>,
1120 #[serde(
1124 rename = "page_token",
1125 alias = "pageToken",
1126 skip_serializing_if = "::core::option::Option::is_none"
1127 )]
1128 pub page_token: ::core::option::Option<::buffa::alloc::string::String>,
1129 #[serde(skip)]
1130 #[doc(hidden)]
1131 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1132}
1133impl ::core::fmt::Debug for ListRecipientsRequest {
1134 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1135 f.debug_struct("ListRecipientsRequest")
1136 .field("max_results", &self.max_results)
1137 .field("page_token", &self.page_token)
1138 .finish()
1139 }
1140}
1141impl ListRecipientsRequest {
1142 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.ListRecipientsRequest";
1147}
1148impl ListRecipientsRequest {
1149 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1150 #[inline]
1151 pub fn with_max_results(mut self, value: i32) -> Self {
1153 self.max_results = Some(value);
1154 self
1155 }
1156 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1157 #[inline]
1158 pub fn with_page_token(
1160 mut self,
1161 value: impl Into<::buffa::alloc::string::String>,
1162 ) -> Self {
1163 self.page_token = Some(value.into());
1164 self
1165 }
1166}
1167impl ::buffa::DefaultInstance for ListRecipientsRequest {
1168 fn default_instance() -> &'static Self {
1169 static VALUE: ::buffa::__private::OnceBox<ListRecipientsRequest> = ::buffa::__private::OnceBox::new();
1170 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1171 }
1172}
1173impl ::buffa::MessageName for ListRecipientsRequest {
1174 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
1175 const NAME: &'static str = "ListRecipientsRequest";
1176 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.ListRecipientsRequest";
1177 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.ListRecipientsRequest";
1178}
1179impl ::buffa::Message for ListRecipientsRequest {
1180 #[allow(clippy::let_and_return)]
1186 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1187 #[allow(unused_imports)]
1188 use ::buffa::Enumeration as _;
1189 let mut size = 0u32;
1190 if let Some(v) = self.max_results {
1191 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
1192 }
1193 if let Some(ref v) = self.page_token {
1194 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1195 }
1196 size += self.__buffa_unknown_fields.encoded_len() as u32;
1197 size
1198 }
1199 fn write_to(
1200 &self,
1201 _cache: &mut ::buffa::SizeCache,
1202 buf: &mut impl ::buffa::bytes::BufMut,
1203 ) {
1204 #[allow(unused_imports)]
1205 use ::buffa::Enumeration as _;
1206 if let Some(v) = self.max_results {
1207 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
1208 .encode(buf);
1209 ::buffa::types::encode_int32(v, buf);
1210 }
1211 if let Some(ref v) = self.page_token {
1212 ::buffa::encoding::Tag::new(
1213 2u32,
1214 ::buffa::encoding::WireType::LengthDelimited,
1215 )
1216 .encode(buf);
1217 ::buffa::types::encode_string(v, buf);
1218 }
1219 self.__buffa_unknown_fields.write_to(buf);
1220 }
1221 fn merge_field(
1222 &mut self,
1223 tag: ::buffa::encoding::Tag,
1224 buf: &mut impl ::buffa::bytes::Buf,
1225 depth: u32,
1226 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1227 #[allow(unused_imports)]
1228 use ::buffa::bytes::Buf as _;
1229 #[allow(unused_imports)]
1230 use ::buffa::Enumeration as _;
1231 match tag.field_number() {
1232 1u32 => {
1233 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1234 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1235 field_number: 1u32,
1236 expected: 0u8,
1237 actual: tag.wire_type() as u8,
1238 });
1239 }
1240 self.max_results = ::core::option::Option::Some(
1241 ::buffa::types::decode_int32(buf)?,
1242 );
1243 }
1244 2u32 => {
1245 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1246 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1247 field_number: 2u32,
1248 expected: 2u8,
1249 actual: tag.wire_type() as u8,
1250 });
1251 }
1252 ::buffa::types::merge_string(
1253 self
1254 .page_token
1255 .get_or_insert_with(::buffa::alloc::string::String::new),
1256 buf,
1257 )?;
1258 }
1259 _ => {
1260 self.__buffa_unknown_fields
1261 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1262 }
1263 }
1264 ::core::result::Result::Ok(())
1265 }
1266 fn clear(&mut self) {
1267 self.max_results = ::core::option::Option::None;
1268 self.page_token = ::core::option::Option::None;
1269 self.__buffa_unknown_fields.clear();
1270 }
1271}
1272impl ::buffa::ExtensionSet for ListRecipientsRequest {
1273 const PROTO_FQN: &'static str = "unitycatalog.recipients.v1.ListRecipientsRequest";
1274 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1275 &self.__buffa_unknown_fields
1276 }
1277 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1278 &mut self.__buffa_unknown_fields
1279 }
1280}
1281impl ::buffa::json_helpers::ProtoElemJson for ListRecipientsRequest {
1282 fn serialize_proto_json<S: ::serde::Serializer>(
1283 v: &Self,
1284 s: S,
1285 ) -> ::core::result::Result<S::Ok, S::Error> {
1286 ::serde::Serialize::serialize(v, s)
1287 }
1288 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1289 d: D,
1290 ) -> ::core::result::Result<Self, D::Error> {
1291 <Self as ::serde::Deserialize>::deserialize(d)
1292 }
1293}
1294#[doc(hidden)]
1295pub const __LIST_RECIPIENTS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1296 type_url: "type.googleapis.com/unitycatalog.recipients.v1.ListRecipientsRequest",
1297 to_json: ::buffa::type_registry::any_to_json::<ListRecipientsRequest>,
1298 from_json: ::buffa::type_registry::any_from_json::<ListRecipientsRequest>,
1299 is_wkt: false,
1300};
1301#[derive(Clone, PartialEq, Default)]
1303#[derive(::serde::Serialize, ::serde::Deserialize)]
1304#[serde(default)]
1305pub struct ListRecipientsResponse {
1306 #[serde(
1310 rename = "recipients",
1311 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1312 deserialize_with = "::buffa::json_helpers::null_as_default"
1313 )]
1314 pub recipients: ::buffa::alloc::vec::Vec<Recipient>,
1315 #[serde(
1319 rename = "next_page_token",
1320 alias = "nextPageToken",
1321 skip_serializing_if = "::core::option::Option::is_none"
1322 )]
1323 pub next_page_token: ::core::option::Option<::buffa::alloc::string::String>,
1324 #[serde(skip)]
1325 #[doc(hidden)]
1326 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1327}
1328impl ::core::fmt::Debug for ListRecipientsResponse {
1329 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1330 f.debug_struct("ListRecipientsResponse")
1331 .field("recipients", &self.recipients)
1332 .field("next_page_token", &self.next_page_token)
1333 .finish()
1334 }
1335}
1336impl ListRecipientsResponse {
1337 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.ListRecipientsResponse";
1342}
1343impl ListRecipientsResponse {
1344 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1345 #[inline]
1346 pub fn with_next_page_token(
1348 mut self,
1349 value: impl Into<::buffa::alloc::string::String>,
1350 ) -> Self {
1351 self.next_page_token = Some(value.into());
1352 self
1353 }
1354}
1355impl ::buffa::DefaultInstance for ListRecipientsResponse {
1356 fn default_instance() -> &'static Self {
1357 static VALUE: ::buffa::__private::OnceBox<ListRecipientsResponse> = ::buffa::__private::OnceBox::new();
1358 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1359 }
1360}
1361impl ::buffa::MessageName for ListRecipientsResponse {
1362 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
1363 const NAME: &'static str = "ListRecipientsResponse";
1364 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.ListRecipientsResponse";
1365 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.ListRecipientsResponse";
1366}
1367impl ::buffa::Message for ListRecipientsResponse {
1368 #[allow(clippy::let_and_return)]
1374 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1375 #[allow(unused_imports)]
1376 use ::buffa::Enumeration as _;
1377 let mut size = 0u32;
1378 for v in &self.recipients {
1379 let __slot = __cache.reserve();
1380 let inner_size = v.compute_size(__cache);
1381 __cache.set(__slot, inner_size);
1382 size
1383 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1384 + inner_size;
1385 }
1386 if let Some(ref v) = self.next_page_token {
1387 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1388 }
1389 size += self.__buffa_unknown_fields.encoded_len() as u32;
1390 size
1391 }
1392 fn write_to(
1393 &self,
1394 __cache: &mut ::buffa::SizeCache,
1395 buf: &mut impl ::buffa::bytes::BufMut,
1396 ) {
1397 #[allow(unused_imports)]
1398 use ::buffa::Enumeration as _;
1399 for v in &self.recipients {
1400 ::buffa::encoding::Tag::new(
1401 1u32,
1402 ::buffa::encoding::WireType::LengthDelimited,
1403 )
1404 .encode(buf);
1405 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1406 v.write_to(__cache, buf);
1407 }
1408 if let Some(ref v) = self.next_page_token {
1409 ::buffa::encoding::Tag::new(
1410 2u32,
1411 ::buffa::encoding::WireType::LengthDelimited,
1412 )
1413 .encode(buf);
1414 ::buffa::types::encode_string(v, buf);
1415 }
1416 self.__buffa_unknown_fields.write_to(buf);
1417 }
1418 fn merge_field(
1419 &mut self,
1420 tag: ::buffa::encoding::Tag,
1421 buf: &mut impl ::buffa::bytes::Buf,
1422 depth: u32,
1423 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1424 #[allow(unused_imports)]
1425 use ::buffa::bytes::Buf as _;
1426 #[allow(unused_imports)]
1427 use ::buffa::Enumeration as _;
1428 match tag.field_number() {
1429 1u32 => {
1430 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1431 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1432 field_number: 1u32,
1433 expected: 2u8,
1434 actual: tag.wire_type() as u8,
1435 });
1436 }
1437 let mut elem = ::core::default::Default::default();
1438 ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
1439 self.recipients.push(elem);
1440 }
1441 2u32 => {
1442 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1443 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1444 field_number: 2u32,
1445 expected: 2u8,
1446 actual: tag.wire_type() as u8,
1447 });
1448 }
1449 ::buffa::types::merge_string(
1450 self
1451 .next_page_token
1452 .get_or_insert_with(::buffa::alloc::string::String::new),
1453 buf,
1454 )?;
1455 }
1456 _ => {
1457 self.__buffa_unknown_fields
1458 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1459 }
1460 }
1461 ::core::result::Result::Ok(())
1462 }
1463 fn clear(&mut self) {
1464 self.recipients.clear();
1465 self.next_page_token = ::core::option::Option::None;
1466 self.__buffa_unknown_fields.clear();
1467 }
1468}
1469impl ::buffa::ExtensionSet for ListRecipientsResponse {
1470 const PROTO_FQN: &'static str = "unitycatalog.recipients.v1.ListRecipientsResponse";
1471 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1472 &self.__buffa_unknown_fields
1473 }
1474 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1475 &mut self.__buffa_unknown_fields
1476 }
1477}
1478impl ::buffa::json_helpers::ProtoElemJson for ListRecipientsResponse {
1479 fn serialize_proto_json<S: ::serde::Serializer>(
1480 v: &Self,
1481 s: S,
1482 ) -> ::core::result::Result<S::Ok, S::Error> {
1483 ::serde::Serialize::serialize(v, s)
1484 }
1485 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1486 d: D,
1487 ) -> ::core::result::Result<Self, D::Error> {
1488 <Self as ::serde::Deserialize>::deserialize(d)
1489 }
1490}
1491#[doc(hidden)]
1492pub const __LIST_RECIPIENTS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1493 type_url: "type.googleapis.com/unitycatalog.recipients.v1.ListRecipientsResponse",
1494 to_json: ::buffa::type_registry::any_to_json::<ListRecipientsResponse>,
1495 from_json: ::buffa::type_registry::any_from_json::<ListRecipientsResponse>,
1496 is_wkt: false,
1497};
1498#[derive(Clone, PartialEq, Default)]
1500#[derive(::serde::Serialize, ::serde::Deserialize)]
1501#[serde(default)]
1502pub struct CreateRecipientRequest {
1503 #[serde(
1507 rename = "name",
1508 with = "::buffa::json_helpers::proto_string",
1509 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1510 )]
1511 pub name: ::buffa::alloc::string::String,
1512 #[serde(
1516 rename = "authentication_type",
1517 alias = "authenticationType",
1518 with = "::buffa::json_helpers::proto_enum",
1519 skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
1520 )]
1521 pub authentication_type: ::buffa::EnumValue<AuthenticationType>,
1522 #[serde(
1526 rename = "owner",
1527 with = "::buffa::json_helpers::proto_string",
1528 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1529 )]
1530 pub owner: ::buffa::alloc::string::String,
1531 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
1535 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
1536 #[serde(
1543 rename = "properties",
1544 skip_serializing_if = "::buffa::__private::HashMap::is_empty",
1545 deserialize_with = "::buffa::json_helpers::null_as_default"
1546 )]
1547 pub properties: ::buffa::__private::HashMap<
1548 ::buffa::alloc::string::String,
1549 ::buffa::alloc::string::String,
1550 >,
1551 #[serde(
1555 rename = "expiration_time",
1556 alias = "expirationTime",
1557 with = "::buffa::json_helpers::opt_int64",
1558 skip_serializing_if = "::core::option::Option::is_none"
1559 )]
1560 pub expiration_time: ::core::option::Option<i64>,
1561 #[serde(skip)]
1562 #[doc(hidden)]
1563 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1564}
1565impl ::core::fmt::Debug for CreateRecipientRequest {
1566 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1567 f.debug_struct("CreateRecipientRequest")
1568 .field("name", &self.name)
1569 .field("authentication_type", &self.authentication_type)
1570 .field("owner", &self.owner)
1571 .field("comment", &self.comment)
1572 .field("properties", &self.properties)
1573 .field("expiration_time", &self.expiration_time)
1574 .finish()
1575 }
1576}
1577impl CreateRecipientRequest {
1578 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.CreateRecipientRequest";
1583}
1584impl CreateRecipientRequest {
1585 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1586 #[inline]
1587 pub fn with_comment(
1589 mut self,
1590 value: impl Into<::buffa::alloc::string::String>,
1591 ) -> Self {
1592 self.comment = Some(value.into());
1593 self
1594 }
1595 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1596 #[inline]
1597 pub fn with_expiration_time(mut self, value: i64) -> Self {
1599 self.expiration_time = Some(value);
1600 self
1601 }
1602}
1603impl ::buffa::DefaultInstance for CreateRecipientRequest {
1604 fn default_instance() -> &'static Self {
1605 static VALUE: ::buffa::__private::OnceBox<CreateRecipientRequest> = ::buffa::__private::OnceBox::new();
1606 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1607 }
1608}
1609impl ::buffa::MessageName for CreateRecipientRequest {
1610 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
1611 const NAME: &'static str = "CreateRecipientRequest";
1612 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.CreateRecipientRequest";
1613 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.CreateRecipientRequest";
1614}
1615impl ::buffa::Message for CreateRecipientRequest {
1616 #[allow(clippy::let_and_return)]
1622 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1623 #[allow(unused_imports)]
1624 use ::buffa::Enumeration as _;
1625 let mut size = 0u32;
1626 if !self.name.is_empty() {
1627 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
1628 }
1629 {
1630 let val = self.authentication_type.to_i32();
1631 if val != 0 {
1632 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
1633 }
1634 }
1635 if !self.owner.is_empty() {
1636 size += 1u32 + ::buffa::types::string_encoded_len(&self.owner) as u32;
1637 }
1638 if let Some(ref v) = self.comment {
1639 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1640 }
1641 #[allow(clippy::for_kv_map)]
1642 for (k, v) in &self.properties {
1643 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
1644 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1645 size
1646 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
1647 + entry_size;
1648 }
1649 if let Some(v) = self.expiration_time {
1650 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
1651 }
1652 size += self.__buffa_unknown_fields.encoded_len() as u32;
1653 size
1654 }
1655 fn write_to(
1656 &self,
1657 _cache: &mut ::buffa::SizeCache,
1658 buf: &mut impl ::buffa::bytes::BufMut,
1659 ) {
1660 #[allow(unused_imports)]
1661 use ::buffa::Enumeration as _;
1662 if !self.name.is_empty() {
1663 ::buffa::encoding::Tag::new(
1664 1u32,
1665 ::buffa::encoding::WireType::LengthDelimited,
1666 )
1667 .encode(buf);
1668 ::buffa::types::encode_string(&self.name, buf);
1669 }
1670 {
1671 let val = self.authentication_type.to_i32();
1672 if val != 0 {
1673 ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
1674 .encode(buf);
1675 ::buffa::types::encode_int32(val, buf);
1676 }
1677 }
1678 if !self.owner.is_empty() {
1679 ::buffa::encoding::Tag::new(
1680 3u32,
1681 ::buffa::encoding::WireType::LengthDelimited,
1682 )
1683 .encode(buf);
1684 ::buffa::types::encode_string(&self.owner, buf);
1685 }
1686 if let Some(ref v) = self.comment {
1687 ::buffa::encoding::Tag::new(
1688 4u32,
1689 ::buffa::encoding::WireType::LengthDelimited,
1690 )
1691 .encode(buf);
1692 ::buffa::types::encode_string(v, buf);
1693 }
1694 for (k, v) in &self.properties {
1695 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
1696 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1697 ::buffa::encoding::Tag::new(
1698 5u32,
1699 ::buffa::encoding::WireType::LengthDelimited,
1700 )
1701 .encode(buf);
1702 ::buffa::encoding::encode_varint(entry_size as u64, buf);
1703 ::buffa::encoding::Tag::new(
1704 1u32,
1705 ::buffa::encoding::WireType::LengthDelimited,
1706 )
1707 .encode(buf);
1708 ::buffa::types::encode_string(k, buf);
1709 ::buffa::encoding::Tag::new(
1710 2u32,
1711 ::buffa::encoding::WireType::LengthDelimited,
1712 )
1713 .encode(buf);
1714 ::buffa::types::encode_string(v, buf);
1715 }
1716 if let Some(v) = self.expiration_time {
1717 ::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
1718 .encode(buf);
1719 ::buffa::types::encode_int64(v, buf);
1720 }
1721 self.__buffa_unknown_fields.write_to(buf);
1722 }
1723 fn merge_field(
1724 &mut self,
1725 tag: ::buffa::encoding::Tag,
1726 buf: &mut impl ::buffa::bytes::Buf,
1727 depth: u32,
1728 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1729 #[allow(unused_imports)]
1730 use ::buffa::bytes::Buf as _;
1731 #[allow(unused_imports)]
1732 use ::buffa::Enumeration as _;
1733 match tag.field_number() {
1734 1u32 => {
1735 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1736 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1737 field_number: 1u32,
1738 expected: 2u8,
1739 actual: tag.wire_type() as u8,
1740 });
1741 }
1742 ::buffa::types::merge_string(&mut self.name, buf)?;
1743 }
1744 2u32 => {
1745 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1746 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1747 field_number: 2u32,
1748 expected: 0u8,
1749 actual: tag.wire_type() as u8,
1750 });
1751 }
1752 self.authentication_type = ::buffa::EnumValue::from(
1753 ::buffa::types::decode_int32(buf)?,
1754 );
1755 }
1756 3u32 => {
1757 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1758 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1759 field_number: 3u32,
1760 expected: 2u8,
1761 actual: tag.wire_type() as u8,
1762 });
1763 }
1764 ::buffa::types::merge_string(&mut self.owner, buf)?;
1765 }
1766 4u32 => {
1767 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1768 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1769 field_number: 4u32,
1770 expected: 2u8,
1771 actual: tag.wire_type() as u8,
1772 });
1773 }
1774 ::buffa::types::merge_string(
1775 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
1776 buf,
1777 )?;
1778 }
1779 5u32 => {
1780 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1781 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1782 field_number: 5u32,
1783 expected: 2u8,
1784 actual: tag.wire_type() as u8,
1785 });
1786 }
1787 let entry_len = ::buffa::encoding::decode_varint(buf)?;
1788 let entry_len = usize::try_from(entry_len)
1789 .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
1790 if buf.remaining() < entry_len {
1791 return ::core::result::Result::Err(
1792 ::buffa::DecodeError::UnexpectedEof,
1793 );
1794 }
1795 let entry_limit = buf.remaining() - entry_len;
1796 let mut key = ::core::default::Default::default();
1797 let mut val = ::core::default::Default::default();
1798 while buf.remaining() > entry_limit {
1799 let entry_tag = ::buffa::encoding::Tag::decode(buf)?;
1800 match entry_tag.field_number() {
1801 1 => {
1802 if entry_tag.wire_type()
1803 != ::buffa::encoding::WireType::LengthDelimited
1804 {
1805 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1806 field_number: entry_tag.field_number(),
1807 expected: 2u8,
1808 actual: entry_tag.wire_type() as u8,
1809 });
1810 }
1811 key = ::buffa::types::decode_string(buf)?;
1812 }
1813 2 => {
1814 if entry_tag.wire_type()
1815 != ::buffa::encoding::WireType::LengthDelimited
1816 {
1817 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1818 field_number: entry_tag.field_number(),
1819 expected: 2u8,
1820 actual: entry_tag.wire_type() as u8,
1821 });
1822 }
1823 val = ::buffa::types::decode_string(buf)?;
1824 }
1825 _ => {
1826 ::buffa::encoding::skip_field_depth(entry_tag, buf, depth)?;
1827 }
1828 }
1829 }
1830 if buf.remaining() != entry_limit {
1831 let remaining = buf.remaining();
1832 if remaining > entry_limit {
1833 buf.advance(remaining - entry_limit);
1834 } else {
1835 return ::core::result::Result::Err(
1836 ::buffa::DecodeError::UnexpectedEof,
1837 );
1838 }
1839 }
1840 self.properties.insert(key, val);
1841 }
1842 6u32 => {
1843 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1844 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1845 field_number: 6u32,
1846 expected: 0u8,
1847 actual: tag.wire_type() as u8,
1848 });
1849 }
1850 self.expiration_time = ::core::option::Option::Some(
1851 ::buffa::types::decode_int64(buf)?,
1852 );
1853 }
1854 _ => {
1855 self.__buffa_unknown_fields
1856 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1857 }
1858 }
1859 ::core::result::Result::Ok(())
1860 }
1861 fn clear(&mut self) {
1862 self.name.clear();
1863 self.authentication_type = ::buffa::EnumValue::from(0);
1864 self.owner.clear();
1865 self.comment = ::core::option::Option::None;
1866 self.properties.clear();
1867 self.expiration_time = ::core::option::Option::None;
1868 self.__buffa_unknown_fields.clear();
1869 }
1870}
1871impl ::buffa::ExtensionSet for CreateRecipientRequest {
1872 const PROTO_FQN: &'static str = "unitycatalog.recipients.v1.CreateRecipientRequest";
1873 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1874 &self.__buffa_unknown_fields
1875 }
1876 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1877 &mut self.__buffa_unknown_fields
1878 }
1879}
1880impl ::buffa::json_helpers::ProtoElemJson for CreateRecipientRequest {
1881 fn serialize_proto_json<S: ::serde::Serializer>(
1882 v: &Self,
1883 s: S,
1884 ) -> ::core::result::Result<S::Ok, S::Error> {
1885 ::serde::Serialize::serialize(v, s)
1886 }
1887 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1888 d: D,
1889 ) -> ::core::result::Result<Self, D::Error> {
1890 <Self as ::serde::Deserialize>::deserialize(d)
1891 }
1892}
1893#[doc(hidden)]
1894pub const __CREATE_RECIPIENT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1895 type_url: "type.googleapis.com/unitycatalog.recipients.v1.CreateRecipientRequest",
1896 to_json: ::buffa::type_registry::any_to_json::<CreateRecipientRequest>,
1897 from_json: ::buffa::type_registry::any_from_json::<CreateRecipientRequest>,
1898 is_wkt: false,
1899};
1900#[derive(Clone, PartialEq, Default)]
1902#[derive(::serde::Serialize, ::serde::Deserialize)]
1903#[serde(default)]
1904pub struct GetRecipientRequest {
1905 #[serde(
1909 rename = "name",
1910 with = "::buffa::json_helpers::proto_string",
1911 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1912 )]
1913 pub name: ::buffa::alloc::string::String,
1914 #[serde(skip)]
1915 #[doc(hidden)]
1916 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1917}
1918impl ::core::fmt::Debug for GetRecipientRequest {
1919 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1920 f.debug_struct("GetRecipientRequest").field("name", &self.name).finish()
1921 }
1922}
1923impl GetRecipientRequest {
1924 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.GetRecipientRequest";
1929}
1930impl ::buffa::DefaultInstance for GetRecipientRequest {
1931 fn default_instance() -> &'static Self {
1932 static VALUE: ::buffa::__private::OnceBox<GetRecipientRequest> = ::buffa::__private::OnceBox::new();
1933 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1934 }
1935}
1936impl ::buffa::MessageName for GetRecipientRequest {
1937 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
1938 const NAME: &'static str = "GetRecipientRequest";
1939 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.GetRecipientRequest";
1940 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.GetRecipientRequest";
1941}
1942impl ::buffa::Message for GetRecipientRequest {
1943 #[allow(clippy::let_and_return)]
1949 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1950 #[allow(unused_imports)]
1951 use ::buffa::Enumeration as _;
1952 let mut size = 0u32;
1953 if !self.name.is_empty() {
1954 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
1955 }
1956 size += self.__buffa_unknown_fields.encoded_len() as u32;
1957 size
1958 }
1959 fn write_to(
1960 &self,
1961 _cache: &mut ::buffa::SizeCache,
1962 buf: &mut impl ::buffa::bytes::BufMut,
1963 ) {
1964 #[allow(unused_imports)]
1965 use ::buffa::Enumeration as _;
1966 if !self.name.is_empty() {
1967 ::buffa::encoding::Tag::new(
1968 1u32,
1969 ::buffa::encoding::WireType::LengthDelimited,
1970 )
1971 .encode(buf);
1972 ::buffa::types::encode_string(&self.name, buf);
1973 }
1974 self.__buffa_unknown_fields.write_to(buf);
1975 }
1976 fn merge_field(
1977 &mut self,
1978 tag: ::buffa::encoding::Tag,
1979 buf: &mut impl ::buffa::bytes::Buf,
1980 depth: u32,
1981 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1982 #[allow(unused_imports)]
1983 use ::buffa::bytes::Buf as _;
1984 #[allow(unused_imports)]
1985 use ::buffa::Enumeration as _;
1986 match tag.field_number() {
1987 1u32 => {
1988 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1989 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1990 field_number: 1u32,
1991 expected: 2u8,
1992 actual: tag.wire_type() as u8,
1993 });
1994 }
1995 ::buffa::types::merge_string(&mut self.name, buf)?;
1996 }
1997 _ => {
1998 self.__buffa_unknown_fields
1999 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2000 }
2001 }
2002 ::core::result::Result::Ok(())
2003 }
2004 fn clear(&mut self) {
2005 self.name.clear();
2006 self.__buffa_unknown_fields.clear();
2007 }
2008}
2009impl ::buffa::ExtensionSet for GetRecipientRequest {
2010 const PROTO_FQN: &'static str = "unitycatalog.recipients.v1.GetRecipientRequest";
2011 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2012 &self.__buffa_unknown_fields
2013 }
2014 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2015 &mut self.__buffa_unknown_fields
2016 }
2017}
2018impl ::buffa::json_helpers::ProtoElemJson for GetRecipientRequest {
2019 fn serialize_proto_json<S: ::serde::Serializer>(
2020 v: &Self,
2021 s: S,
2022 ) -> ::core::result::Result<S::Ok, S::Error> {
2023 ::serde::Serialize::serialize(v, s)
2024 }
2025 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2026 d: D,
2027 ) -> ::core::result::Result<Self, D::Error> {
2028 <Self as ::serde::Deserialize>::deserialize(d)
2029 }
2030}
2031#[doc(hidden)]
2032pub const __GET_RECIPIENT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2033 type_url: "type.googleapis.com/unitycatalog.recipients.v1.GetRecipientRequest",
2034 to_json: ::buffa::type_registry::any_to_json::<GetRecipientRequest>,
2035 from_json: ::buffa::type_registry::any_from_json::<GetRecipientRequest>,
2036 is_wkt: false,
2037};
2038#[derive(Clone, PartialEq, Default)]
2040#[derive(::serde::Serialize, ::serde::Deserialize)]
2041#[serde(default)]
2042pub struct UpdateRecipientRequest {
2043 #[serde(
2047 rename = "name",
2048 with = "::buffa::json_helpers::proto_string",
2049 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2050 )]
2051 pub name: ::buffa::alloc::string::String,
2052 #[serde(
2056 rename = "new_name",
2057 alias = "newName",
2058 skip_serializing_if = "::core::option::Option::is_none"
2059 )]
2060 pub new_name: ::core::option::Option<::buffa::alloc::string::String>,
2061 #[serde(rename = "owner", skip_serializing_if = "::core::option::Option::is_none")]
2065 pub owner: ::core::option::Option<::buffa::alloc::string::String>,
2066 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
2070 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
2071 #[serde(
2078 rename = "properties",
2079 skip_serializing_if = "::buffa::__private::HashMap::is_empty",
2080 deserialize_with = "::buffa::json_helpers::null_as_default"
2081 )]
2082 pub properties: ::buffa::__private::HashMap<
2083 ::buffa::alloc::string::String,
2084 ::buffa::alloc::string::String,
2085 >,
2086 #[serde(
2090 rename = "expiration_time",
2091 alias = "expirationTime",
2092 with = "::buffa::json_helpers::opt_int64",
2093 skip_serializing_if = "::core::option::Option::is_none"
2094 )]
2095 pub expiration_time: ::core::option::Option<i64>,
2096 #[serde(skip)]
2097 #[doc(hidden)]
2098 pub __buffa_unknown_fields: ::buffa::UnknownFields,
2099}
2100impl ::core::fmt::Debug for UpdateRecipientRequest {
2101 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2102 f.debug_struct("UpdateRecipientRequest")
2103 .field("name", &self.name)
2104 .field("new_name", &self.new_name)
2105 .field("owner", &self.owner)
2106 .field("comment", &self.comment)
2107 .field("properties", &self.properties)
2108 .field("expiration_time", &self.expiration_time)
2109 .finish()
2110 }
2111}
2112impl UpdateRecipientRequest {
2113 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.UpdateRecipientRequest";
2118}
2119impl UpdateRecipientRequest {
2120 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2121 #[inline]
2122 pub fn with_new_name(
2124 mut self,
2125 value: impl Into<::buffa::alloc::string::String>,
2126 ) -> Self {
2127 self.new_name = Some(value.into());
2128 self
2129 }
2130 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2131 #[inline]
2132 pub fn with_owner(
2134 mut self,
2135 value: impl Into<::buffa::alloc::string::String>,
2136 ) -> Self {
2137 self.owner = Some(value.into());
2138 self
2139 }
2140 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2141 #[inline]
2142 pub fn with_comment(
2144 mut self,
2145 value: impl Into<::buffa::alloc::string::String>,
2146 ) -> Self {
2147 self.comment = Some(value.into());
2148 self
2149 }
2150 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2151 #[inline]
2152 pub fn with_expiration_time(mut self, value: i64) -> Self {
2154 self.expiration_time = Some(value);
2155 self
2156 }
2157}
2158impl ::buffa::DefaultInstance for UpdateRecipientRequest {
2159 fn default_instance() -> &'static Self {
2160 static VALUE: ::buffa::__private::OnceBox<UpdateRecipientRequest> = ::buffa::__private::OnceBox::new();
2161 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2162 }
2163}
2164impl ::buffa::MessageName for UpdateRecipientRequest {
2165 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
2166 const NAME: &'static str = "UpdateRecipientRequest";
2167 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.UpdateRecipientRequest";
2168 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.UpdateRecipientRequest";
2169}
2170impl ::buffa::Message for UpdateRecipientRequest {
2171 #[allow(clippy::let_and_return)]
2177 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2178 #[allow(unused_imports)]
2179 use ::buffa::Enumeration as _;
2180 let mut size = 0u32;
2181 if !self.name.is_empty() {
2182 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
2183 }
2184 if let Some(ref v) = self.new_name {
2185 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2186 }
2187 if let Some(ref v) = self.owner {
2188 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2189 }
2190 if let Some(ref v) = self.comment {
2191 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2192 }
2193 #[allow(clippy::for_kv_map)]
2194 for (k, v) in &self.properties {
2195 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
2196 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2197 size
2198 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
2199 + entry_size;
2200 }
2201 if let Some(v) = self.expiration_time {
2202 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
2203 }
2204 size += self.__buffa_unknown_fields.encoded_len() as u32;
2205 size
2206 }
2207 fn write_to(
2208 &self,
2209 _cache: &mut ::buffa::SizeCache,
2210 buf: &mut impl ::buffa::bytes::BufMut,
2211 ) {
2212 #[allow(unused_imports)]
2213 use ::buffa::Enumeration as _;
2214 if !self.name.is_empty() {
2215 ::buffa::encoding::Tag::new(
2216 1u32,
2217 ::buffa::encoding::WireType::LengthDelimited,
2218 )
2219 .encode(buf);
2220 ::buffa::types::encode_string(&self.name, buf);
2221 }
2222 if let Some(ref v) = self.new_name {
2223 ::buffa::encoding::Tag::new(
2224 2u32,
2225 ::buffa::encoding::WireType::LengthDelimited,
2226 )
2227 .encode(buf);
2228 ::buffa::types::encode_string(v, buf);
2229 }
2230 if let Some(ref v) = self.owner {
2231 ::buffa::encoding::Tag::new(
2232 3u32,
2233 ::buffa::encoding::WireType::LengthDelimited,
2234 )
2235 .encode(buf);
2236 ::buffa::types::encode_string(v, buf);
2237 }
2238 if let Some(ref v) = self.comment {
2239 ::buffa::encoding::Tag::new(
2240 4u32,
2241 ::buffa::encoding::WireType::LengthDelimited,
2242 )
2243 .encode(buf);
2244 ::buffa::types::encode_string(v, buf);
2245 }
2246 for (k, v) in &self.properties {
2247 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
2248 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2249 ::buffa::encoding::Tag::new(
2250 5u32,
2251 ::buffa::encoding::WireType::LengthDelimited,
2252 )
2253 .encode(buf);
2254 ::buffa::encoding::encode_varint(entry_size as u64, buf);
2255 ::buffa::encoding::Tag::new(
2256 1u32,
2257 ::buffa::encoding::WireType::LengthDelimited,
2258 )
2259 .encode(buf);
2260 ::buffa::types::encode_string(k, buf);
2261 ::buffa::encoding::Tag::new(
2262 2u32,
2263 ::buffa::encoding::WireType::LengthDelimited,
2264 )
2265 .encode(buf);
2266 ::buffa::types::encode_string(v, buf);
2267 }
2268 if let Some(v) = self.expiration_time {
2269 ::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
2270 .encode(buf);
2271 ::buffa::types::encode_int64(v, buf);
2272 }
2273 self.__buffa_unknown_fields.write_to(buf);
2274 }
2275 fn merge_field(
2276 &mut self,
2277 tag: ::buffa::encoding::Tag,
2278 buf: &mut impl ::buffa::bytes::Buf,
2279 depth: u32,
2280 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2281 #[allow(unused_imports)]
2282 use ::buffa::bytes::Buf as _;
2283 #[allow(unused_imports)]
2284 use ::buffa::Enumeration as _;
2285 match tag.field_number() {
2286 1u32 => {
2287 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2288 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2289 field_number: 1u32,
2290 expected: 2u8,
2291 actual: tag.wire_type() as u8,
2292 });
2293 }
2294 ::buffa::types::merge_string(&mut self.name, buf)?;
2295 }
2296 2u32 => {
2297 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2298 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2299 field_number: 2u32,
2300 expected: 2u8,
2301 actual: tag.wire_type() as u8,
2302 });
2303 }
2304 ::buffa::types::merge_string(
2305 self
2306 .new_name
2307 .get_or_insert_with(::buffa::alloc::string::String::new),
2308 buf,
2309 )?;
2310 }
2311 3u32 => {
2312 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2313 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2314 field_number: 3u32,
2315 expected: 2u8,
2316 actual: tag.wire_type() as u8,
2317 });
2318 }
2319 ::buffa::types::merge_string(
2320 self.owner.get_or_insert_with(::buffa::alloc::string::String::new),
2321 buf,
2322 )?;
2323 }
2324 4u32 => {
2325 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2326 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2327 field_number: 4u32,
2328 expected: 2u8,
2329 actual: tag.wire_type() as u8,
2330 });
2331 }
2332 ::buffa::types::merge_string(
2333 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
2334 buf,
2335 )?;
2336 }
2337 5u32 => {
2338 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2339 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2340 field_number: 5u32,
2341 expected: 2u8,
2342 actual: tag.wire_type() as u8,
2343 });
2344 }
2345 let entry_len = ::buffa::encoding::decode_varint(buf)?;
2346 let entry_len = usize::try_from(entry_len)
2347 .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
2348 if buf.remaining() < entry_len {
2349 return ::core::result::Result::Err(
2350 ::buffa::DecodeError::UnexpectedEof,
2351 );
2352 }
2353 let entry_limit = buf.remaining() - entry_len;
2354 let mut key = ::core::default::Default::default();
2355 let mut val = ::core::default::Default::default();
2356 while buf.remaining() > entry_limit {
2357 let entry_tag = ::buffa::encoding::Tag::decode(buf)?;
2358 match entry_tag.field_number() {
2359 1 => {
2360 if entry_tag.wire_type()
2361 != ::buffa::encoding::WireType::LengthDelimited
2362 {
2363 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2364 field_number: entry_tag.field_number(),
2365 expected: 2u8,
2366 actual: entry_tag.wire_type() as u8,
2367 });
2368 }
2369 key = ::buffa::types::decode_string(buf)?;
2370 }
2371 2 => {
2372 if entry_tag.wire_type()
2373 != ::buffa::encoding::WireType::LengthDelimited
2374 {
2375 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2376 field_number: entry_tag.field_number(),
2377 expected: 2u8,
2378 actual: entry_tag.wire_type() as u8,
2379 });
2380 }
2381 val = ::buffa::types::decode_string(buf)?;
2382 }
2383 _ => {
2384 ::buffa::encoding::skip_field_depth(entry_tag, buf, depth)?;
2385 }
2386 }
2387 }
2388 if buf.remaining() != entry_limit {
2389 let remaining = buf.remaining();
2390 if remaining > entry_limit {
2391 buf.advance(remaining - entry_limit);
2392 } else {
2393 return ::core::result::Result::Err(
2394 ::buffa::DecodeError::UnexpectedEof,
2395 );
2396 }
2397 }
2398 self.properties.insert(key, val);
2399 }
2400 6u32 => {
2401 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2402 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2403 field_number: 6u32,
2404 expected: 0u8,
2405 actual: tag.wire_type() as u8,
2406 });
2407 }
2408 self.expiration_time = ::core::option::Option::Some(
2409 ::buffa::types::decode_int64(buf)?,
2410 );
2411 }
2412 _ => {
2413 self.__buffa_unknown_fields
2414 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2415 }
2416 }
2417 ::core::result::Result::Ok(())
2418 }
2419 fn clear(&mut self) {
2420 self.name.clear();
2421 self.new_name = ::core::option::Option::None;
2422 self.owner = ::core::option::Option::None;
2423 self.comment = ::core::option::Option::None;
2424 self.properties.clear();
2425 self.expiration_time = ::core::option::Option::None;
2426 self.__buffa_unknown_fields.clear();
2427 }
2428}
2429impl ::buffa::ExtensionSet for UpdateRecipientRequest {
2430 const PROTO_FQN: &'static str = "unitycatalog.recipients.v1.UpdateRecipientRequest";
2431 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2432 &self.__buffa_unknown_fields
2433 }
2434 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2435 &mut self.__buffa_unknown_fields
2436 }
2437}
2438impl ::buffa::json_helpers::ProtoElemJson for UpdateRecipientRequest {
2439 fn serialize_proto_json<S: ::serde::Serializer>(
2440 v: &Self,
2441 s: S,
2442 ) -> ::core::result::Result<S::Ok, S::Error> {
2443 ::serde::Serialize::serialize(v, s)
2444 }
2445 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2446 d: D,
2447 ) -> ::core::result::Result<Self, D::Error> {
2448 <Self as ::serde::Deserialize>::deserialize(d)
2449 }
2450}
2451#[doc(hidden)]
2452pub const __UPDATE_RECIPIENT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2453 type_url: "type.googleapis.com/unitycatalog.recipients.v1.UpdateRecipientRequest",
2454 to_json: ::buffa::type_registry::any_to_json::<UpdateRecipientRequest>,
2455 from_json: ::buffa::type_registry::any_from_json::<UpdateRecipientRequest>,
2456 is_wkt: false,
2457};
2458#[derive(Clone, PartialEq, Default)]
2460#[derive(::serde::Serialize, ::serde::Deserialize)]
2461#[serde(default)]
2462pub struct DeleteRecipientRequest {
2463 #[serde(
2467 rename = "name",
2468 with = "::buffa::json_helpers::proto_string",
2469 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2470 )]
2471 pub name: ::buffa::alloc::string::String,
2472 #[serde(skip)]
2473 #[doc(hidden)]
2474 pub __buffa_unknown_fields: ::buffa::UnknownFields,
2475}
2476impl ::core::fmt::Debug for DeleteRecipientRequest {
2477 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2478 f.debug_struct("DeleteRecipientRequest").field("name", &self.name).finish()
2479 }
2480}
2481impl DeleteRecipientRequest {
2482 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.DeleteRecipientRequest";
2487}
2488impl ::buffa::DefaultInstance for DeleteRecipientRequest {
2489 fn default_instance() -> &'static Self {
2490 static VALUE: ::buffa::__private::OnceBox<DeleteRecipientRequest> = ::buffa::__private::OnceBox::new();
2491 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2492 }
2493}
2494impl ::buffa::MessageName for DeleteRecipientRequest {
2495 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
2496 const NAME: &'static str = "DeleteRecipientRequest";
2497 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.DeleteRecipientRequest";
2498 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.DeleteRecipientRequest";
2499}
2500impl ::buffa::Message for DeleteRecipientRequest {
2501 #[allow(clippy::let_and_return)]
2507 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2508 #[allow(unused_imports)]
2509 use ::buffa::Enumeration as _;
2510 let mut size = 0u32;
2511 if !self.name.is_empty() {
2512 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
2513 }
2514 size += self.__buffa_unknown_fields.encoded_len() as u32;
2515 size
2516 }
2517 fn write_to(
2518 &self,
2519 _cache: &mut ::buffa::SizeCache,
2520 buf: &mut impl ::buffa::bytes::BufMut,
2521 ) {
2522 #[allow(unused_imports)]
2523 use ::buffa::Enumeration as _;
2524 if !self.name.is_empty() {
2525 ::buffa::encoding::Tag::new(
2526 1u32,
2527 ::buffa::encoding::WireType::LengthDelimited,
2528 )
2529 .encode(buf);
2530 ::buffa::types::encode_string(&self.name, buf);
2531 }
2532 self.__buffa_unknown_fields.write_to(buf);
2533 }
2534 fn merge_field(
2535 &mut self,
2536 tag: ::buffa::encoding::Tag,
2537 buf: &mut impl ::buffa::bytes::Buf,
2538 depth: u32,
2539 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2540 #[allow(unused_imports)]
2541 use ::buffa::bytes::Buf as _;
2542 #[allow(unused_imports)]
2543 use ::buffa::Enumeration as _;
2544 match tag.field_number() {
2545 1u32 => {
2546 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2547 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2548 field_number: 1u32,
2549 expected: 2u8,
2550 actual: tag.wire_type() as u8,
2551 });
2552 }
2553 ::buffa::types::merge_string(&mut self.name, buf)?;
2554 }
2555 _ => {
2556 self.__buffa_unknown_fields
2557 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2558 }
2559 }
2560 ::core::result::Result::Ok(())
2561 }
2562 fn clear(&mut self) {
2563 self.name.clear();
2564 self.__buffa_unknown_fields.clear();
2565 }
2566}
2567impl ::buffa::ExtensionSet for DeleteRecipientRequest {
2568 const PROTO_FQN: &'static str = "unitycatalog.recipients.v1.DeleteRecipientRequest";
2569 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2570 &self.__buffa_unknown_fields
2571 }
2572 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2573 &mut self.__buffa_unknown_fields
2574 }
2575}
2576impl ::buffa::json_helpers::ProtoElemJson for DeleteRecipientRequest {
2577 fn serialize_proto_json<S: ::serde::Serializer>(
2578 v: &Self,
2579 s: S,
2580 ) -> ::core::result::Result<S::Ok, S::Error> {
2581 ::serde::Serialize::serialize(v, s)
2582 }
2583 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2584 d: D,
2585 ) -> ::core::result::Result<Self, D::Error> {
2586 <Self as ::serde::Deserialize>::deserialize(d)
2587 }
2588}
2589#[doc(hidden)]
2590pub const __DELETE_RECIPIENT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2591 type_url: "type.googleapis.com/unitycatalog.recipients.v1.DeleteRecipientRequest",
2592 to_json: ::buffa::type_registry::any_to_json::<DeleteRecipientRequest>,
2593 from_json: ::buffa::type_registry::any_from_json::<DeleteRecipientRequest>,
2594 is_wkt: false,
2595};
2596#[allow(
2597 non_camel_case_types,
2598 dead_code,
2599 unused_imports,
2600 unused_qualifications,
2601 clippy::derivable_impls,
2602 clippy::match_single_binding,
2603 clippy::uninlined_format_args,
2604 clippy::doc_lazy_continuation,
2605 clippy::module_inception
2606)]
2607pub mod __buffa {
2608 #[allow(unused_imports)]
2609 use super::*;
2610 pub mod view {
2611 #[allow(unused_imports)]
2612 use super::*;
2613 #[derive(Clone, Debug, Default)]
2614 pub struct RecipientTokenView<'a> {
2615 pub id: &'a str,
2619 pub created_at: i64,
2623 pub created_by: &'a str,
2627 pub activation_url: &'a str,
2631 pub expiration_time: i64,
2635 pub updated_at: i64,
2639 pub updated_by: &'a str,
2643 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2644 }
2645 impl<'a> RecipientTokenView<'a> {
2646 #[doc(hidden)]
2654 pub fn _decode_depth(
2655 buf: &'a [u8],
2656 depth: u32,
2657 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2658 let mut view = Self::default();
2659 view._merge_into_view(buf, depth)?;
2660 ::core::result::Result::Ok(view)
2661 }
2662 #[doc(hidden)]
2670 pub fn _merge_into_view(
2671 &mut self,
2672 buf: &'a [u8],
2673 depth: u32,
2674 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2675 let _ = depth;
2676 #[allow(unused_variables)]
2677 let view = self;
2678 let mut cur: &'a [u8] = buf;
2679 while !cur.is_empty() {
2680 let before_tag = cur;
2681 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
2682 match tag.field_number() {
2683 1u32 => {
2684 if tag.wire_type()
2685 != ::buffa::encoding::WireType::LengthDelimited
2686 {
2687 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2688 field_number: 1u32,
2689 expected: 2u8,
2690 actual: tag.wire_type() as u8,
2691 });
2692 }
2693 view.id = ::buffa::types::borrow_str(&mut cur)?;
2694 }
2695 2u32 => {
2696 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2697 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2698 field_number: 2u32,
2699 expected: 0u8,
2700 actual: tag.wire_type() as u8,
2701 });
2702 }
2703 view.created_at = ::buffa::types::decode_int64(&mut cur)?;
2704 }
2705 3u32 => {
2706 if tag.wire_type()
2707 != ::buffa::encoding::WireType::LengthDelimited
2708 {
2709 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2710 field_number: 3u32,
2711 expected: 2u8,
2712 actual: tag.wire_type() as u8,
2713 });
2714 }
2715 view.created_by = ::buffa::types::borrow_str(&mut cur)?;
2716 }
2717 4u32 => {
2718 if tag.wire_type()
2719 != ::buffa::encoding::WireType::LengthDelimited
2720 {
2721 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2722 field_number: 4u32,
2723 expected: 2u8,
2724 actual: tag.wire_type() as u8,
2725 });
2726 }
2727 view.activation_url = ::buffa::types::borrow_str(&mut cur)?;
2728 }
2729 5u32 => {
2730 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2731 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2732 field_number: 5u32,
2733 expected: 0u8,
2734 actual: tag.wire_type() as u8,
2735 });
2736 }
2737 view.expiration_time = ::buffa::types::decode_int64(
2738 &mut cur,
2739 )?;
2740 }
2741 6u32 => {
2742 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2743 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2744 field_number: 6u32,
2745 expected: 0u8,
2746 actual: tag.wire_type() as u8,
2747 });
2748 }
2749 view.updated_at = ::buffa::types::decode_int64(&mut cur)?;
2750 }
2751 7u32 => {
2752 if tag.wire_type()
2753 != ::buffa::encoding::WireType::LengthDelimited
2754 {
2755 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2756 field_number: 7u32,
2757 expected: 2u8,
2758 actual: tag.wire_type() as u8,
2759 });
2760 }
2761 view.updated_by = ::buffa::types::borrow_str(&mut cur)?;
2762 }
2763 _ => {
2764 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
2765 let span_len = before_tag.len() - cur.len();
2766 view.__buffa_unknown_fields
2767 .push_raw(&before_tag[..span_len]);
2768 }
2769 }
2770 }
2771 ::core::result::Result::Ok(())
2772 }
2773 }
2774 impl<'a> ::buffa::MessageView<'a> for RecipientTokenView<'a> {
2775 type Owned = super::super::RecipientToken;
2776 fn decode_view(
2777 buf: &'a [u8],
2778 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2779 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
2780 }
2781 fn decode_view_with_limit(
2782 buf: &'a [u8],
2783 depth: u32,
2784 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2785 Self::_decode_depth(buf, depth)
2786 }
2787 fn to_owned_message(&self) -> super::super::RecipientToken {
2788 self.to_owned_from_source(None)
2789 }
2790 #[allow(clippy::useless_conversion, clippy::needless_update)]
2791 fn to_owned_from_source(
2792 &self,
2793 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
2794 ) -> super::super::RecipientToken {
2795 #[allow(unused_imports)]
2796 use ::buffa::alloc::string::ToString as _;
2797 let _ = __buffa_src;
2798 super::super::RecipientToken {
2799 id: self.id.to_string(),
2800 created_at: self.created_at,
2801 created_by: self.created_by.to_string(),
2802 activation_url: self.activation_url.to_string(),
2803 expiration_time: self.expiration_time,
2804 updated_at: self.updated_at,
2805 updated_by: self.updated_by.to_string(),
2806 __buffa_unknown_fields: self
2807 .__buffa_unknown_fields
2808 .to_owned()
2809 .unwrap_or_default()
2810 .into(),
2811 ..::core::default::Default::default()
2812 }
2813 }
2814 }
2815 impl<'a> ::buffa::ViewEncode<'a> for RecipientTokenView<'a> {
2816 #[allow(clippy::needless_borrow, clippy::let_and_return)]
2817 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2818 #[allow(unused_imports)]
2819 use ::buffa::Enumeration as _;
2820 let mut size = 0u32;
2821 if !self.id.is_empty() {
2822 size += 1u32 + ::buffa::types::string_encoded_len(&self.id) as u32;
2823 }
2824 if self.created_at != 0i64 {
2825 size
2826 += 1u32
2827 + ::buffa::types::int64_encoded_len(self.created_at) as u32;
2828 }
2829 if !self.created_by.is_empty() {
2830 size
2831 += 1u32
2832 + ::buffa::types::string_encoded_len(&self.created_by)
2833 as u32;
2834 }
2835 if !self.activation_url.is_empty() {
2836 size
2837 += 1u32
2838 + ::buffa::types::string_encoded_len(&self.activation_url)
2839 as u32;
2840 }
2841 if self.expiration_time != 0i64 {
2842 size
2843 += 1u32
2844 + ::buffa::types::int64_encoded_len(self.expiration_time)
2845 as u32;
2846 }
2847 if self.updated_at != 0i64 {
2848 size
2849 += 1u32
2850 + ::buffa::types::int64_encoded_len(self.updated_at) as u32;
2851 }
2852 if !self.updated_by.is_empty() {
2853 size
2854 += 1u32
2855 + ::buffa::types::string_encoded_len(&self.updated_by)
2856 as u32;
2857 }
2858 size += self.__buffa_unknown_fields.encoded_len() as u32;
2859 size
2860 }
2861 #[allow(clippy::needless_borrow)]
2862 fn write_to(
2863 &self,
2864 _cache: &mut ::buffa::SizeCache,
2865 buf: &mut impl ::buffa::bytes::BufMut,
2866 ) {
2867 #[allow(unused_imports)]
2868 use ::buffa::Enumeration as _;
2869 if !self.id.is_empty() {
2870 ::buffa::encoding::Tag::new(
2871 1u32,
2872 ::buffa::encoding::WireType::LengthDelimited,
2873 )
2874 .encode(buf);
2875 ::buffa::types::encode_string(&self.id, buf);
2876 }
2877 if self.created_at != 0i64 {
2878 ::buffa::encoding::Tag::new(
2879 2u32,
2880 ::buffa::encoding::WireType::Varint,
2881 )
2882 .encode(buf);
2883 ::buffa::types::encode_int64(self.created_at, buf);
2884 }
2885 if !self.created_by.is_empty() {
2886 ::buffa::encoding::Tag::new(
2887 3u32,
2888 ::buffa::encoding::WireType::LengthDelimited,
2889 )
2890 .encode(buf);
2891 ::buffa::types::encode_string(&self.created_by, buf);
2892 }
2893 if !self.activation_url.is_empty() {
2894 ::buffa::encoding::Tag::new(
2895 4u32,
2896 ::buffa::encoding::WireType::LengthDelimited,
2897 )
2898 .encode(buf);
2899 ::buffa::types::encode_string(&self.activation_url, buf);
2900 }
2901 if self.expiration_time != 0i64 {
2902 ::buffa::encoding::Tag::new(
2903 5u32,
2904 ::buffa::encoding::WireType::Varint,
2905 )
2906 .encode(buf);
2907 ::buffa::types::encode_int64(self.expiration_time, buf);
2908 }
2909 if self.updated_at != 0i64 {
2910 ::buffa::encoding::Tag::new(
2911 6u32,
2912 ::buffa::encoding::WireType::Varint,
2913 )
2914 .encode(buf);
2915 ::buffa::types::encode_int64(self.updated_at, buf);
2916 }
2917 if !self.updated_by.is_empty() {
2918 ::buffa::encoding::Tag::new(
2919 7u32,
2920 ::buffa::encoding::WireType::LengthDelimited,
2921 )
2922 .encode(buf);
2923 ::buffa::types::encode_string(&self.updated_by, buf);
2924 }
2925 self.__buffa_unknown_fields.write_to(buf);
2926 }
2927 }
2928 impl<'__a> ::serde::Serialize for RecipientTokenView<'__a> {
2940 fn serialize<__S: ::serde::Serializer>(
2941 &self,
2942 __s: __S,
2943 ) -> ::core::result::Result<__S::Ok, __S::Error> {
2944 use ::serde::ser::SerializeMap as _;
2945 let mut __map = __s.serialize_map(::core::option::Option::None)?;
2946 if !::buffa::json_helpers::skip_if::is_empty_str(self.id) {
2947 __map.serialize_entry("id", self.id)?;
2948 }
2949 if !::buffa::json_helpers::skip_if::is_zero_i64(&self.created_at) {
2950 struct _W(i64);
2951 impl ::serde::Serialize for _W {
2952 fn serialize<__S: ::serde::Serializer>(
2953 &self,
2954 __s: __S,
2955 ) -> ::core::result::Result<__S::Ok, __S::Error> {
2956 ::buffa::json_helpers::int64::serialize(&self.0, __s)
2957 }
2958 }
2959 __map.serialize_entry("created_at", &_W(self.created_at))?;
2960 }
2961 if !::buffa::json_helpers::skip_if::is_empty_str(self.created_by) {
2962 __map.serialize_entry("created_by", self.created_by)?;
2963 }
2964 if !::buffa::json_helpers::skip_if::is_empty_str(self.activation_url) {
2965 __map.serialize_entry("activation_url", self.activation_url)?;
2966 }
2967 if !::buffa::json_helpers::skip_if::is_zero_i64(&self.expiration_time) {
2968 struct _W(i64);
2969 impl ::serde::Serialize for _W {
2970 fn serialize<__S: ::serde::Serializer>(
2971 &self,
2972 __s: __S,
2973 ) -> ::core::result::Result<__S::Ok, __S::Error> {
2974 ::buffa::json_helpers::int64::serialize(&self.0, __s)
2975 }
2976 }
2977 __map.serialize_entry("expiration_time", &_W(self.expiration_time))?;
2978 }
2979 if !::buffa::json_helpers::skip_if::is_zero_i64(&self.updated_at) {
2980 struct _W(i64);
2981 impl ::serde::Serialize for _W {
2982 fn serialize<__S: ::serde::Serializer>(
2983 &self,
2984 __s: __S,
2985 ) -> ::core::result::Result<__S::Ok, __S::Error> {
2986 ::buffa::json_helpers::int64::serialize(&self.0, __s)
2987 }
2988 }
2989 __map.serialize_entry("updated_at", &_W(self.updated_at))?;
2990 }
2991 if !::buffa::json_helpers::skip_if::is_empty_str(self.updated_by) {
2992 __map.serialize_entry("updated_by", self.updated_by)?;
2993 }
2994 __map.end()
2995 }
2996 }
2997 impl<'a> ::buffa::MessageName for RecipientTokenView<'a> {
2998 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
2999 const NAME: &'static str = "RecipientToken";
3000 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.RecipientToken";
3001 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.RecipientToken";
3002 }
3003 impl<'v> ::buffa::DefaultViewInstance for RecipientTokenView<'v> {
3004 fn default_view_instance<'a>() -> &'a Self
3005 where
3006 Self: 'a,
3007 {
3008 static VALUE: ::buffa::__private::OnceBox<RecipientTokenView<'static>> = ::buffa::__private::OnceBox::new();
3009 VALUE
3010 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
3011 <RecipientTokenView<'static>>::default(),
3012 ))
3013 }
3014 }
3015 impl ::buffa::ViewReborrow for RecipientTokenView<'static> {
3016 type Reborrowed<'b> = RecipientTokenView<'b>;
3017 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
3018 this
3019 }
3020 }
3021 #[derive(Clone, Debug)]
3027 pub struct RecipientTokenOwnedView(
3028 ::buffa::OwnedView<RecipientTokenView<'static>>,
3029 );
3030 impl RecipientTokenOwnedView {
3031 pub fn decode(
3041 bytes: ::buffa::bytes::Bytes,
3042 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3043 ::core::result::Result::Ok(
3044 RecipientTokenOwnedView(::buffa::OwnedView::decode(bytes)?),
3045 )
3046 }
3047 pub fn decode_with_options(
3055 bytes: ::buffa::bytes::Bytes,
3056 opts: &::buffa::DecodeOptions,
3057 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3058 ::core::result::Result::Ok(
3059 RecipientTokenOwnedView(
3060 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
3061 ),
3062 )
3063 }
3064 pub fn from_owned(
3071 msg: &super::super::RecipientToken,
3072 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3073 ::core::result::Result::Ok(
3074 RecipientTokenOwnedView(::buffa::OwnedView::from_owned(msg)?),
3075 )
3076 }
3077 #[must_use]
3079 pub fn view(&self) -> &RecipientTokenView<'_> {
3080 self.0.reborrow()
3081 }
3082 #[must_use]
3084 pub fn to_owned_message(&self) -> super::super::RecipientToken {
3085 self.0.to_owned_message()
3086 }
3087 #[must_use]
3089 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3090 self.0.bytes()
3091 }
3092 #[must_use]
3094 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3095 self.0.into_bytes()
3096 }
3097 #[must_use]
3101 pub fn id(&self) -> &'_ str {
3102 self.0.reborrow().id
3103 }
3104 #[must_use]
3108 pub fn created_at(&self) -> i64 {
3109 self.0.reborrow().created_at
3110 }
3111 #[must_use]
3115 pub fn created_by(&self) -> &'_ str {
3116 self.0.reborrow().created_by
3117 }
3118 #[must_use]
3122 pub fn activation_url(&self) -> &'_ str {
3123 self.0.reborrow().activation_url
3124 }
3125 #[must_use]
3129 pub fn expiration_time(&self) -> i64 {
3130 self.0.reborrow().expiration_time
3131 }
3132 #[must_use]
3136 pub fn updated_at(&self) -> i64 {
3137 self.0.reborrow().updated_at
3138 }
3139 #[must_use]
3143 pub fn updated_by(&self) -> &'_ str {
3144 self.0.reborrow().updated_by
3145 }
3146 }
3147 impl ::core::convert::From<::buffa::OwnedView<RecipientTokenView<'static>>>
3148 for RecipientTokenOwnedView {
3149 fn from(inner: ::buffa::OwnedView<RecipientTokenView<'static>>) -> Self {
3150 RecipientTokenOwnedView(inner)
3151 }
3152 }
3153 impl ::core::convert::From<RecipientTokenOwnedView>
3154 for ::buffa::OwnedView<RecipientTokenView<'static>> {
3155 fn from(wrapper: RecipientTokenOwnedView) -> Self {
3156 wrapper.0
3157 }
3158 }
3159 impl ::core::convert::AsRef<::buffa::OwnedView<RecipientTokenView<'static>>>
3160 for RecipientTokenOwnedView {
3161 fn as_ref(&self) -> &::buffa::OwnedView<RecipientTokenView<'static>> {
3162 &self.0
3163 }
3164 }
3165 impl ::buffa::HasMessageView for super::super::RecipientToken {
3166 type View<'a> = RecipientTokenView<'a>;
3167 type ViewHandle = RecipientTokenOwnedView;
3168 }
3169 impl ::serde::Serialize for RecipientTokenOwnedView {
3170 fn serialize<__S: ::serde::Serializer>(
3171 &self,
3172 __s: __S,
3173 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3174 ::serde::Serialize::serialize(&self.0, __s)
3175 }
3176 }
3177 #[derive(Clone, Debug, Default)]
3178 pub struct RecipientView<'a> {
3179 pub id: ::core::option::Option<&'a str>,
3183 pub name: &'a str,
3187 pub authentication_type: ::buffa::EnumValue<
3191 super::super::AuthenticationType,
3192 >,
3193 pub owner: ::core::option::Option<&'a str>,
3197 pub comment: ::core::option::Option<&'a str>,
3201 pub properties: ::buffa::MapView<'a, &'a str, &'a str>,
3205 pub created_at: ::core::option::Option<i64>,
3209 pub created_by: ::core::option::Option<&'a str>,
3213 pub tokens: ::buffa::RepeatedView<
3217 'a,
3218 super::super::__buffa::view::RecipientTokenView<'a>,
3219 >,
3220 pub updated_at: ::core::option::Option<i64>,
3224 pub updated_by: ::core::option::Option<&'a str>,
3228 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
3229 }
3230 impl<'a> RecipientView<'a> {
3231 #[doc(hidden)]
3239 pub fn _decode_depth(
3240 buf: &'a [u8],
3241 depth: u32,
3242 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3243 let mut view = Self::default();
3244 view._merge_into_view(buf, depth)?;
3245 ::core::result::Result::Ok(view)
3246 }
3247 #[doc(hidden)]
3255 pub fn _merge_into_view(
3256 &mut self,
3257 buf: &'a [u8],
3258 depth: u32,
3259 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3260 let _ = depth;
3261 #[allow(unused_variables)]
3262 let view = self;
3263 let mut cur: &'a [u8] = buf;
3264 while !cur.is_empty() {
3265 let before_tag = cur;
3266 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
3267 match tag.field_number() {
3268 100u32 => {
3269 if tag.wire_type()
3270 != ::buffa::encoding::WireType::LengthDelimited
3271 {
3272 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3273 field_number: 100u32,
3274 expected: 2u8,
3275 actual: tag.wire_type() as u8,
3276 });
3277 }
3278 view.id = Some(::buffa::types::borrow_str(&mut cur)?);
3279 }
3280 1u32 => {
3281 if tag.wire_type()
3282 != ::buffa::encoding::WireType::LengthDelimited
3283 {
3284 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3285 field_number: 1u32,
3286 expected: 2u8,
3287 actual: tag.wire_type() as u8,
3288 });
3289 }
3290 view.name = ::buffa::types::borrow_str(&mut cur)?;
3291 }
3292 2u32 => {
3293 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3294 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3295 field_number: 2u32,
3296 expected: 0u8,
3297 actual: tag.wire_type() as u8,
3298 });
3299 }
3300 view.authentication_type = ::buffa::EnumValue::from(
3301 ::buffa::types::decode_int32(&mut cur)?,
3302 );
3303 }
3304 3u32 => {
3305 if tag.wire_type()
3306 != ::buffa::encoding::WireType::LengthDelimited
3307 {
3308 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3309 field_number: 3u32,
3310 expected: 2u8,
3311 actual: tag.wire_type() as u8,
3312 });
3313 }
3314 view.owner = Some(::buffa::types::borrow_str(&mut cur)?);
3315 }
3316 4u32 => {
3317 if tag.wire_type()
3318 != ::buffa::encoding::WireType::LengthDelimited
3319 {
3320 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3321 field_number: 4u32,
3322 expected: 2u8,
3323 actual: tag.wire_type() as u8,
3324 });
3325 }
3326 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
3327 }
3328 7u32 => {
3329 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3330 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3331 field_number: 7u32,
3332 expected: 0u8,
3333 actual: tag.wire_type() as u8,
3334 });
3335 }
3336 view.created_at = Some(
3337 ::buffa::types::decode_int64(&mut cur)?,
3338 );
3339 }
3340 8u32 => {
3341 if tag.wire_type()
3342 != ::buffa::encoding::WireType::LengthDelimited
3343 {
3344 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3345 field_number: 8u32,
3346 expected: 2u8,
3347 actual: tag.wire_type() as u8,
3348 });
3349 }
3350 view.created_by = Some(
3351 ::buffa::types::borrow_str(&mut cur)?,
3352 );
3353 }
3354 10u32 => {
3355 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3356 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3357 field_number: 10u32,
3358 expected: 0u8,
3359 actual: tag.wire_type() as u8,
3360 });
3361 }
3362 view.updated_at = Some(
3363 ::buffa::types::decode_int64(&mut cur)?,
3364 );
3365 }
3366 11u32 => {
3367 if tag.wire_type()
3368 != ::buffa::encoding::WireType::LengthDelimited
3369 {
3370 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3371 field_number: 11u32,
3372 expected: 2u8,
3373 actual: tag.wire_type() as u8,
3374 });
3375 }
3376 view.updated_by = Some(
3377 ::buffa::types::borrow_str(&mut cur)?,
3378 );
3379 }
3380 9u32 => {
3381 if tag.wire_type()
3382 != ::buffa::encoding::WireType::LengthDelimited
3383 {
3384 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3385 field_number: 9u32,
3386 expected: 2u8,
3387 actual: tag.wire_type() as u8,
3388 });
3389 }
3390 if depth == 0 {
3391 return Err(::buffa::DecodeError::RecursionLimitExceeded);
3392 }
3393 let sub = ::buffa::types::borrow_bytes(&mut cur)?;
3394 view.tokens
3395 .push(
3396 super::super::__buffa::view::RecipientTokenView::_decode_depth(
3397 sub,
3398 depth - 1,
3399 )?,
3400 );
3401 }
3402 6u32 => {
3403 if tag.wire_type()
3404 != ::buffa::encoding::WireType::LengthDelimited
3405 {
3406 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3407 field_number: 6u32,
3408 expected: 2u8,
3409 actual: tag.wire_type() as u8,
3410 });
3411 }
3412 let entry_bytes = ::buffa::types::borrow_bytes(&mut cur)?;
3413 let mut entry_cur: &'a [u8] = entry_bytes;
3414 let mut key = "";
3415 let mut val = "";
3416 while !entry_cur.is_empty() {
3417 let entry_tag = ::buffa::encoding::Tag::decode(
3418 &mut entry_cur,
3419 )?;
3420 match entry_tag.field_number() {
3421 1 => {
3422 if entry_tag.wire_type()
3423 != ::buffa::encoding::WireType::LengthDelimited
3424 {
3425 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3426 field_number: entry_tag.field_number(),
3427 expected: 2u8,
3428 actual: entry_tag.wire_type() as u8,
3429 });
3430 }
3431 key = ::buffa::types::borrow_str(&mut entry_cur)?;
3432 }
3433 2 => {
3434 if entry_tag.wire_type()
3435 != ::buffa::encoding::WireType::LengthDelimited
3436 {
3437 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3438 field_number: entry_tag.field_number(),
3439 expected: 2u8,
3440 actual: entry_tag.wire_type() as u8,
3441 });
3442 }
3443 val = ::buffa::types::borrow_str(&mut entry_cur)?;
3444 }
3445 _ => {
3446 ::buffa::encoding::skip_field_depth(
3447 entry_tag,
3448 &mut entry_cur,
3449 depth,
3450 )?;
3451 }
3452 }
3453 }
3454 view.properties.push(key, val);
3455 }
3456 _ => {
3457 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
3458 let span_len = before_tag.len() - cur.len();
3459 view.__buffa_unknown_fields
3460 .push_raw(&before_tag[..span_len]);
3461 }
3462 }
3463 }
3464 ::core::result::Result::Ok(())
3465 }
3466 }
3467 impl<'a> ::buffa::MessageView<'a> for RecipientView<'a> {
3468 type Owned = super::super::Recipient;
3469 fn decode_view(
3470 buf: &'a [u8],
3471 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3472 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
3473 }
3474 fn decode_view_with_limit(
3475 buf: &'a [u8],
3476 depth: u32,
3477 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3478 Self::_decode_depth(buf, depth)
3479 }
3480 fn to_owned_message(&self) -> super::super::Recipient {
3481 self.to_owned_from_source(None)
3482 }
3483 #[allow(clippy::useless_conversion, clippy::needless_update)]
3484 fn to_owned_from_source(
3485 &self,
3486 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3487 ) -> super::super::Recipient {
3488 #[allow(unused_imports)]
3489 use ::buffa::alloc::string::ToString as _;
3490 let _ = __buffa_src;
3491 super::super::Recipient {
3492 id: self.id.map(|s| s.to_string()),
3493 name: self.name.to_string(),
3494 authentication_type: self.authentication_type,
3495 owner: self.owner.map(|s| s.to_string()),
3496 comment: self.comment.map(|s| s.to_string()),
3497 properties: self
3498 .properties
3499 .iter()
3500 .map(|(k, v)| (k.to_string(), v.to_string()))
3501 .collect(),
3502 created_at: self.created_at,
3503 created_by: self.created_by.map(|s| s.to_string()),
3504 tokens: self
3505 .tokens
3506 .iter()
3507 .map(|v| v.to_owned_from_source(__buffa_src))
3508 .collect(),
3509 updated_at: self.updated_at,
3510 updated_by: self.updated_by.map(|s| s.to_string()),
3511 __buffa_unknown_fields: self
3512 .__buffa_unknown_fields
3513 .to_owned()
3514 .unwrap_or_default()
3515 .into(),
3516 ..::core::default::Default::default()
3517 }
3518 }
3519 }
3520 impl<'a> ::buffa::ViewEncode<'a> for RecipientView<'a> {
3521 #[allow(clippy::needless_borrow, clippy::let_and_return)]
3522 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
3523 #[allow(unused_imports)]
3524 use ::buffa::Enumeration as _;
3525 let mut size = 0u32;
3526 if !self.name.is_empty() {
3527 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
3528 }
3529 {
3530 let val = self.authentication_type.to_i32();
3531 if val != 0 {
3532 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
3533 }
3534 }
3535 if let Some(ref v) = self.owner {
3536 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3537 }
3538 if let Some(ref v) = self.comment {
3539 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3540 }
3541 #[allow(clippy::for_kv_map)]
3542 for (k, v) in &self.properties {
3543 let entry_size: u32 = 1u32
3544 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
3545 + ::buffa::types::string_encoded_len(v) as u32;
3546 size
3547 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
3548 + entry_size;
3549 }
3550 if let Some(v) = self.created_at {
3551 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
3552 }
3553 if let Some(ref v) = self.created_by {
3554 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3555 }
3556 for v in &self.tokens {
3557 let __slot = __cache.reserve();
3558 let inner_size = v.compute_size(__cache);
3559 __cache.set(__slot, inner_size);
3560 size
3561 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
3562 + inner_size;
3563 }
3564 if let Some(v) = self.updated_at {
3565 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
3566 }
3567 if let Some(ref v) = self.updated_by {
3568 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3569 }
3570 if let Some(ref v) = self.id {
3571 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
3572 }
3573 size += self.__buffa_unknown_fields.encoded_len() as u32;
3574 size
3575 }
3576 #[allow(clippy::needless_borrow)]
3577 fn write_to(
3578 &self,
3579 __cache: &mut ::buffa::SizeCache,
3580 buf: &mut impl ::buffa::bytes::BufMut,
3581 ) {
3582 #[allow(unused_imports)]
3583 use ::buffa::Enumeration as _;
3584 if !self.name.is_empty() {
3585 ::buffa::encoding::Tag::new(
3586 1u32,
3587 ::buffa::encoding::WireType::LengthDelimited,
3588 )
3589 .encode(buf);
3590 ::buffa::types::encode_string(&self.name, buf);
3591 }
3592 {
3593 let val = self.authentication_type.to_i32();
3594 if val != 0 {
3595 ::buffa::encoding::Tag::new(
3596 2u32,
3597 ::buffa::encoding::WireType::Varint,
3598 )
3599 .encode(buf);
3600 ::buffa::types::encode_int32(val, buf);
3601 }
3602 }
3603 if let Some(ref v) = self.owner {
3604 ::buffa::encoding::Tag::new(
3605 3u32,
3606 ::buffa::encoding::WireType::LengthDelimited,
3607 )
3608 .encode(buf);
3609 ::buffa::types::encode_string(v, buf);
3610 }
3611 if let Some(ref v) = self.comment {
3612 ::buffa::encoding::Tag::new(
3613 4u32,
3614 ::buffa::encoding::WireType::LengthDelimited,
3615 )
3616 .encode(buf);
3617 ::buffa::types::encode_string(v, buf);
3618 }
3619 for (k, v) in &self.properties {
3620 let entry_size: u32 = 1u32
3621 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
3622 + ::buffa::types::string_encoded_len(v) as u32;
3623 ::buffa::encoding::Tag::new(
3624 6u32,
3625 ::buffa::encoding::WireType::LengthDelimited,
3626 )
3627 .encode(buf);
3628 ::buffa::encoding::encode_varint(entry_size as u64, buf);
3629 ::buffa::encoding::Tag::new(
3630 1u32,
3631 ::buffa::encoding::WireType::LengthDelimited,
3632 )
3633 .encode(buf);
3634 ::buffa::types::encode_string(k, buf);
3635 ::buffa::encoding::Tag::new(
3636 2u32,
3637 ::buffa::encoding::WireType::LengthDelimited,
3638 )
3639 .encode(buf);
3640 ::buffa::types::encode_string(v, buf);
3641 }
3642 if let Some(v) = self.created_at {
3643 ::buffa::encoding::Tag::new(
3644 7u32,
3645 ::buffa::encoding::WireType::Varint,
3646 )
3647 .encode(buf);
3648 ::buffa::types::encode_int64(v, buf);
3649 }
3650 if let Some(ref v) = self.created_by {
3651 ::buffa::encoding::Tag::new(
3652 8u32,
3653 ::buffa::encoding::WireType::LengthDelimited,
3654 )
3655 .encode(buf);
3656 ::buffa::types::encode_string(v, buf);
3657 }
3658 for v in &self.tokens {
3659 ::buffa::encoding::Tag::new(
3660 9u32,
3661 ::buffa::encoding::WireType::LengthDelimited,
3662 )
3663 .encode(buf);
3664 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
3665 v.write_to(__cache, buf);
3666 }
3667 if let Some(v) = self.updated_at {
3668 ::buffa::encoding::Tag::new(
3669 10u32,
3670 ::buffa::encoding::WireType::Varint,
3671 )
3672 .encode(buf);
3673 ::buffa::types::encode_int64(v, buf);
3674 }
3675 if let Some(ref v) = self.updated_by {
3676 ::buffa::encoding::Tag::new(
3677 11u32,
3678 ::buffa::encoding::WireType::LengthDelimited,
3679 )
3680 .encode(buf);
3681 ::buffa::types::encode_string(v, buf);
3682 }
3683 if let Some(ref v) = self.id {
3684 ::buffa::encoding::Tag::new(
3685 100u32,
3686 ::buffa::encoding::WireType::LengthDelimited,
3687 )
3688 .encode(buf);
3689 ::buffa::types::encode_string(v, buf);
3690 }
3691 self.__buffa_unknown_fields.write_to(buf);
3692 }
3693 }
3694 impl<'__a> ::serde::Serialize for RecipientView<'__a> {
3706 fn serialize<__S: ::serde::Serializer>(
3707 &self,
3708 __s: __S,
3709 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3710 use ::serde::ser::SerializeMap as _;
3711 let mut __map = __s.serialize_map(::core::option::Option::None)?;
3712 if let ::core::option::Option::Some(__v) = self.id {
3713 __map.serialize_entry("id", __v)?;
3714 }
3715 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
3716 __map.serialize_entry("name", self.name)?;
3717 }
3718 if !::buffa::json_helpers::skip_if::is_default_enum_value(
3719 &self.authentication_type,
3720 ) {
3721 __map
3722 .serialize_entry(
3723 "authenticationType",
3724 &self.authentication_type,
3725 )?;
3726 }
3727 if let ::core::option::Option::Some(__v) = self.owner {
3728 __map.serialize_entry("owner", __v)?;
3729 }
3730 if let ::core::option::Option::Some(__v) = self.comment {
3731 __map.serialize_entry("comment", __v)?;
3732 }
3733 if !self.properties.is_empty() {
3734 struct _WM<'__a, '__x>(
3735 &'__x ::buffa::MapView<'__x, &'__a str, &'__a str>,
3736 );
3737 impl<'__a> ::serde::Serialize for _WM<'__a, '_> {
3738 fn serialize<__S: ::serde::Serializer>(
3739 &self,
3740 __s: __S,
3741 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3742 use ::serde::ser::SerializeMap as _;
3743 let mut __m = __s
3744 .serialize_map(::core::option::Option::Some(self.0.len()))?;
3745 for (k, v) in self.0.iter_unique() {
3746 __m.serialize_entry(k, v)?;
3747 }
3748 __m.end()
3749 }
3750 }
3751 __map.serialize_entry("properties", &_WM(&self.properties))?;
3752 }
3753 if let ::core::option::Option::Some(__v) = self.created_at {
3754 struct _W(i64);
3755 impl ::serde::Serialize for _W {
3756 fn serialize<__S: ::serde::Serializer>(
3757 &self,
3758 __s: __S,
3759 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3760 ::buffa::json_helpers::int64::serialize(&self.0, __s)
3761 }
3762 }
3763 __map.serialize_entry("created_at", &_W(__v))?;
3764 }
3765 if let ::core::option::Option::Some(__v) = self.created_by {
3766 __map.serialize_entry("created_by", __v)?;
3767 }
3768 if !self.tokens.is_empty() {
3769 __map.serialize_entry("tokens", &*self.tokens)?;
3770 }
3771 if let ::core::option::Option::Some(__v) = self.updated_at {
3772 struct _W(i64);
3773 impl ::serde::Serialize for _W {
3774 fn serialize<__S: ::serde::Serializer>(
3775 &self,
3776 __s: __S,
3777 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3778 ::buffa::json_helpers::int64::serialize(&self.0, __s)
3779 }
3780 }
3781 __map.serialize_entry("updated_at", &_W(__v))?;
3782 }
3783 if let ::core::option::Option::Some(__v) = self.updated_by {
3784 __map.serialize_entry("updated_by", __v)?;
3785 }
3786 __map.end()
3787 }
3788 }
3789 impl<'a> ::buffa::MessageName for RecipientView<'a> {
3790 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
3791 const NAME: &'static str = "Recipient";
3792 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.Recipient";
3793 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.Recipient";
3794 }
3795 impl<'v> ::buffa::DefaultViewInstance for RecipientView<'v> {
3796 fn default_view_instance<'a>() -> &'a Self
3797 where
3798 Self: 'a,
3799 {
3800 static VALUE: ::buffa::__private::OnceBox<RecipientView<'static>> = ::buffa::__private::OnceBox::new();
3801 VALUE
3802 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
3803 <RecipientView<'static>>::default(),
3804 ))
3805 }
3806 }
3807 impl ::buffa::ViewReborrow for RecipientView<'static> {
3808 type Reborrowed<'b> = RecipientView<'b>;
3809 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
3810 this
3811 }
3812 }
3813 #[derive(Clone, Debug)]
3819 pub struct RecipientOwnedView(::buffa::OwnedView<RecipientView<'static>>);
3820 impl RecipientOwnedView {
3821 pub fn decode(
3831 bytes: ::buffa::bytes::Bytes,
3832 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3833 ::core::result::Result::Ok(
3834 RecipientOwnedView(::buffa::OwnedView::decode(bytes)?),
3835 )
3836 }
3837 pub fn decode_with_options(
3845 bytes: ::buffa::bytes::Bytes,
3846 opts: &::buffa::DecodeOptions,
3847 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3848 ::core::result::Result::Ok(
3849 RecipientOwnedView(
3850 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
3851 ),
3852 )
3853 }
3854 pub fn from_owned(
3861 msg: &super::super::Recipient,
3862 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3863 ::core::result::Result::Ok(
3864 RecipientOwnedView(::buffa::OwnedView::from_owned(msg)?),
3865 )
3866 }
3867 #[must_use]
3869 pub fn view(&self) -> &RecipientView<'_> {
3870 self.0.reborrow()
3871 }
3872 #[must_use]
3874 pub fn to_owned_message(&self) -> super::super::Recipient {
3875 self.0.to_owned_message()
3876 }
3877 #[must_use]
3879 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3880 self.0.bytes()
3881 }
3882 #[must_use]
3884 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3885 self.0.into_bytes()
3886 }
3887 #[must_use]
3891 pub fn id(&self) -> ::core::option::Option<&'_ str> {
3892 self.0.reborrow().id
3893 }
3894 #[must_use]
3898 pub fn name(&self) -> &'_ str {
3899 self.0.reborrow().name
3900 }
3901 #[must_use]
3905 pub fn authentication_type(
3906 &self,
3907 ) -> ::buffa::EnumValue<super::super::AuthenticationType> {
3908 self.0.reborrow().authentication_type
3909 }
3910 #[must_use]
3914 pub fn owner(&self) -> ::core::option::Option<&'_ str> {
3915 self.0.reborrow().owner
3916 }
3917 #[must_use]
3921 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
3922 self.0.reborrow().comment
3923 }
3924 #[must_use]
3928 pub fn properties(&self) -> &::buffa::MapView<'_, &'_ str, &'_ str> {
3929 &self.0.reborrow().properties
3930 }
3931 #[must_use]
3935 pub fn created_at(&self) -> ::core::option::Option<i64> {
3936 self.0.reborrow().created_at
3937 }
3938 #[must_use]
3942 pub fn created_by(&self) -> ::core::option::Option<&'_ str> {
3943 self.0.reborrow().created_by
3944 }
3945 #[must_use]
3949 pub fn tokens(
3950 &self,
3951 ) -> &::buffa::RepeatedView<
3952 '_,
3953 super::super::__buffa::view::RecipientTokenView<'_>,
3954 > {
3955 &self.0.reborrow().tokens
3956 }
3957 #[must_use]
3961 pub fn updated_at(&self) -> ::core::option::Option<i64> {
3962 self.0.reborrow().updated_at
3963 }
3964 #[must_use]
3968 pub fn updated_by(&self) -> ::core::option::Option<&'_ str> {
3969 self.0.reborrow().updated_by
3970 }
3971 }
3972 impl ::core::convert::From<::buffa::OwnedView<RecipientView<'static>>>
3973 for RecipientOwnedView {
3974 fn from(inner: ::buffa::OwnedView<RecipientView<'static>>) -> Self {
3975 RecipientOwnedView(inner)
3976 }
3977 }
3978 impl ::core::convert::From<RecipientOwnedView>
3979 for ::buffa::OwnedView<RecipientView<'static>> {
3980 fn from(wrapper: RecipientOwnedView) -> Self {
3981 wrapper.0
3982 }
3983 }
3984 impl ::core::convert::AsRef<::buffa::OwnedView<RecipientView<'static>>>
3985 for RecipientOwnedView {
3986 fn as_ref(&self) -> &::buffa::OwnedView<RecipientView<'static>> {
3987 &self.0
3988 }
3989 }
3990 impl ::buffa::HasMessageView for super::super::Recipient {
3991 type View<'a> = RecipientView<'a>;
3992 type ViewHandle = RecipientOwnedView;
3993 }
3994 impl ::serde::Serialize for RecipientOwnedView {
3995 fn serialize<__S: ::serde::Serializer>(
3996 &self,
3997 __s: __S,
3998 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3999 ::serde::Serialize::serialize(&self.0, __s)
4000 }
4001 }
4002 #[derive(Clone, Debug, Default)]
4004 pub struct ListRecipientsRequestView<'a> {
4005 pub max_results: ::core::option::Option<i32>,
4009 pub page_token: ::core::option::Option<&'a str>,
4013 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4014 }
4015 impl<'a> ListRecipientsRequestView<'a> {
4016 #[doc(hidden)]
4024 pub fn _decode_depth(
4025 buf: &'a [u8],
4026 depth: u32,
4027 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4028 let mut view = Self::default();
4029 view._merge_into_view(buf, depth)?;
4030 ::core::result::Result::Ok(view)
4031 }
4032 #[doc(hidden)]
4040 pub fn _merge_into_view(
4041 &mut self,
4042 buf: &'a [u8],
4043 depth: u32,
4044 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4045 let _ = depth;
4046 #[allow(unused_variables)]
4047 let view = self;
4048 let mut cur: &'a [u8] = buf;
4049 while !cur.is_empty() {
4050 let before_tag = cur;
4051 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
4052 match tag.field_number() {
4053 1u32 => {
4054 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4055 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4056 field_number: 1u32,
4057 expected: 0u8,
4058 actual: tag.wire_type() as u8,
4059 });
4060 }
4061 view.max_results = Some(
4062 ::buffa::types::decode_int32(&mut cur)?,
4063 );
4064 }
4065 2u32 => {
4066 if tag.wire_type()
4067 != ::buffa::encoding::WireType::LengthDelimited
4068 {
4069 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4070 field_number: 2u32,
4071 expected: 2u8,
4072 actual: tag.wire_type() as u8,
4073 });
4074 }
4075 view.page_token = Some(
4076 ::buffa::types::borrow_str(&mut cur)?,
4077 );
4078 }
4079 _ => {
4080 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4081 let span_len = before_tag.len() - cur.len();
4082 view.__buffa_unknown_fields
4083 .push_raw(&before_tag[..span_len]);
4084 }
4085 }
4086 }
4087 ::core::result::Result::Ok(())
4088 }
4089 }
4090 impl<'a> ::buffa::MessageView<'a> for ListRecipientsRequestView<'a> {
4091 type Owned = super::super::ListRecipientsRequest;
4092 fn decode_view(
4093 buf: &'a [u8],
4094 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4095 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
4096 }
4097 fn decode_view_with_limit(
4098 buf: &'a [u8],
4099 depth: u32,
4100 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4101 Self::_decode_depth(buf, depth)
4102 }
4103 fn to_owned_message(&self) -> super::super::ListRecipientsRequest {
4104 self.to_owned_from_source(None)
4105 }
4106 #[allow(clippy::useless_conversion, clippy::needless_update)]
4107 fn to_owned_from_source(
4108 &self,
4109 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4110 ) -> super::super::ListRecipientsRequest {
4111 #[allow(unused_imports)]
4112 use ::buffa::alloc::string::ToString as _;
4113 let _ = __buffa_src;
4114 super::super::ListRecipientsRequest {
4115 max_results: self.max_results,
4116 page_token: self.page_token.map(|s| s.to_string()),
4117 __buffa_unknown_fields: self
4118 .__buffa_unknown_fields
4119 .to_owned()
4120 .unwrap_or_default()
4121 .into(),
4122 ..::core::default::Default::default()
4123 }
4124 }
4125 }
4126 impl<'a> ::buffa::ViewEncode<'a> for ListRecipientsRequestView<'a> {
4127 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4128 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
4129 #[allow(unused_imports)]
4130 use ::buffa::Enumeration as _;
4131 let mut size = 0u32;
4132 if let Some(v) = self.max_results {
4133 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
4134 }
4135 if let Some(ref v) = self.page_token {
4136 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4137 }
4138 size += self.__buffa_unknown_fields.encoded_len() as u32;
4139 size
4140 }
4141 #[allow(clippy::needless_borrow)]
4142 fn write_to(
4143 &self,
4144 _cache: &mut ::buffa::SizeCache,
4145 buf: &mut impl ::buffa::bytes::BufMut,
4146 ) {
4147 #[allow(unused_imports)]
4148 use ::buffa::Enumeration as _;
4149 if let Some(v) = self.max_results {
4150 ::buffa::encoding::Tag::new(
4151 1u32,
4152 ::buffa::encoding::WireType::Varint,
4153 )
4154 .encode(buf);
4155 ::buffa::types::encode_int32(v, buf);
4156 }
4157 if let Some(ref v) = self.page_token {
4158 ::buffa::encoding::Tag::new(
4159 2u32,
4160 ::buffa::encoding::WireType::LengthDelimited,
4161 )
4162 .encode(buf);
4163 ::buffa::types::encode_string(v, buf);
4164 }
4165 self.__buffa_unknown_fields.write_to(buf);
4166 }
4167 }
4168 impl<'__a> ::serde::Serialize for ListRecipientsRequestView<'__a> {
4180 fn serialize<__S: ::serde::Serializer>(
4181 &self,
4182 __s: __S,
4183 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4184 use ::serde::ser::SerializeMap as _;
4185 let mut __map = __s.serialize_map(::core::option::Option::None)?;
4186 if let ::core::option::Option::Some(__v) = self.max_results {
4187 struct _W(i32);
4188 impl ::serde::Serialize for _W {
4189 fn serialize<__S: ::serde::Serializer>(
4190 &self,
4191 __s: __S,
4192 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4193 ::buffa::json_helpers::int32::serialize(&self.0, __s)
4194 }
4195 }
4196 __map.serialize_entry("max_results", &_W(__v))?;
4197 }
4198 if let ::core::option::Option::Some(__v) = self.page_token {
4199 __map.serialize_entry("page_token", __v)?;
4200 }
4201 __map.end()
4202 }
4203 }
4204 impl<'a> ::buffa::MessageName for ListRecipientsRequestView<'a> {
4205 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
4206 const NAME: &'static str = "ListRecipientsRequest";
4207 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.ListRecipientsRequest";
4208 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.ListRecipientsRequest";
4209 }
4210 impl<'v> ::buffa::DefaultViewInstance for ListRecipientsRequestView<'v> {
4211 fn default_view_instance<'a>() -> &'a Self
4212 where
4213 Self: 'a,
4214 {
4215 static VALUE: ::buffa::__private::OnceBox<
4216 ListRecipientsRequestView<'static>,
4217 > = ::buffa::__private::OnceBox::new();
4218 VALUE
4219 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
4220 <ListRecipientsRequestView<'static>>::default(),
4221 ))
4222 }
4223 }
4224 impl ::buffa::ViewReborrow for ListRecipientsRequestView<'static> {
4225 type Reborrowed<'b> = ListRecipientsRequestView<'b>;
4226 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
4227 this
4228 }
4229 }
4230 #[derive(Clone, Debug)]
4236 pub struct ListRecipientsRequestOwnedView(
4237 ::buffa::OwnedView<ListRecipientsRequestView<'static>>,
4238 );
4239 impl ListRecipientsRequestOwnedView {
4240 pub fn decode(
4250 bytes: ::buffa::bytes::Bytes,
4251 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4252 ::core::result::Result::Ok(
4253 ListRecipientsRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
4254 )
4255 }
4256 pub fn decode_with_options(
4264 bytes: ::buffa::bytes::Bytes,
4265 opts: &::buffa::DecodeOptions,
4266 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4267 ::core::result::Result::Ok(
4268 ListRecipientsRequestOwnedView(
4269 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4270 ),
4271 )
4272 }
4273 pub fn from_owned(
4280 msg: &super::super::ListRecipientsRequest,
4281 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4282 ::core::result::Result::Ok(
4283 ListRecipientsRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
4284 )
4285 }
4286 #[must_use]
4288 pub fn view(&self) -> &ListRecipientsRequestView<'_> {
4289 self.0.reborrow()
4290 }
4291 #[must_use]
4293 pub fn to_owned_message(&self) -> super::super::ListRecipientsRequest {
4294 self.0.to_owned_message()
4295 }
4296 #[must_use]
4298 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4299 self.0.bytes()
4300 }
4301 #[must_use]
4303 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4304 self.0.into_bytes()
4305 }
4306 #[must_use]
4310 pub fn max_results(&self) -> ::core::option::Option<i32> {
4311 self.0.reborrow().max_results
4312 }
4313 #[must_use]
4317 pub fn page_token(&self) -> ::core::option::Option<&'_ str> {
4318 self.0.reborrow().page_token
4319 }
4320 }
4321 impl ::core::convert::From<
4322 ::buffa::OwnedView<ListRecipientsRequestView<'static>>,
4323 > for ListRecipientsRequestOwnedView {
4324 fn from(
4325 inner: ::buffa::OwnedView<ListRecipientsRequestView<'static>>,
4326 ) -> Self {
4327 ListRecipientsRequestOwnedView(inner)
4328 }
4329 }
4330 impl ::core::convert::From<ListRecipientsRequestOwnedView>
4331 for ::buffa::OwnedView<ListRecipientsRequestView<'static>> {
4332 fn from(wrapper: ListRecipientsRequestOwnedView) -> Self {
4333 wrapper.0
4334 }
4335 }
4336 impl ::core::convert::AsRef<
4337 ::buffa::OwnedView<ListRecipientsRequestView<'static>>,
4338 > for ListRecipientsRequestOwnedView {
4339 fn as_ref(&self) -> &::buffa::OwnedView<ListRecipientsRequestView<'static>> {
4340 &self.0
4341 }
4342 }
4343 impl ::buffa::HasMessageView for super::super::ListRecipientsRequest {
4344 type View<'a> = ListRecipientsRequestView<'a>;
4345 type ViewHandle = ListRecipientsRequestOwnedView;
4346 }
4347 impl ::serde::Serialize for ListRecipientsRequestOwnedView {
4348 fn serialize<__S: ::serde::Serializer>(
4349 &self,
4350 __s: __S,
4351 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4352 ::serde::Serialize::serialize(&self.0, __s)
4353 }
4354 }
4355 #[derive(Clone, Debug, Default)]
4357 pub struct ListRecipientsResponseView<'a> {
4358 pub recipients: ::buffa::RepeatedView<
4362 'a,
4363 super::super::__buffa::view::RecipientView<'a>,
4364 >,
4365 pub next_page_token: ::core::option::Option<&'a str>,
4369 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4370 }
4371 impl<'a> ListRecipientsResponseView<'a> {
4372 #[doc(hidden)]
4380 pub fn _decode_depth(
4381 buf: &'a [u8],
4382 depth: u32,
4383 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4384 let mut view = Self::default();
4385 view._merge_into_view(buf, depth)?;
4386 ::core::result::Result::Ok(view)
4387 }
4388 #[doc(hidden)]
4396 pub fn _merge_into_view(
4397 &mut self,
4398 buf: &'a [u8],
4399 depth: u32,
4400 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4401 let _ = depth;
4402 #[allow(unused_variables)]
4403 let view = self;
4404 let mut cur: &'a [u8] = buf;
4405 while !cur.is_empty() {
4406 let before_tag = cur;
4407 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
4408 match tag.field_number() {
4409 2u32 => {
4410 if tag.wire_type()
4411 != ::buffa::encoding::WireType::LengthDelimited
4412 {
4413 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4414 field_number: 2u32,
4415 expected: 2u8,
4416 actual: tag.wire_type() as u8,
4417 });
4418 }
4419 view.next_page_token = Some(
4420 ::buffa::types::borrow_str(&mut cur)?,
4421 );
4422 }
4423 1u32 => {
4424 if tag.wire_type()
4425 != ::buffa::encoding::WireType::LengthDelimited
4426 {
4427 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4428 field_number: 1u32,
4429 expected: 2u8,
4430 actual: tag.wire_type() as u8,
4431 });
4432 }
4433 if depth == 0 {
4434 return Err(::buffa::DecodeError::RecursionLimitExceeded);
4435 }
4436 let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4437 view.recipients
4438 .push(
4439 super::super::__buffa::view::RecipientView::_decode_depth(
4440 sub,
4441 depth - 1,
4442 )?,
4443 );
4444 }
4445 _ => {
4446 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4447 let span_len = before_tag.len() - cur.len();
4448 view.__buffa_unknown_fields
4449 .push_raw(&before_tag[..span_len]);
4450 }
4451 }
4452 }
4453 ::core::result::Result::Ok(())
4454 }
4455 }
4456 impl<'a> ::buffa::MessageView<'a> for ListRecipientsResponseView<'a> {
4457 type Owned = super::super::ListRecipientsResponse;
4458 fn decode_view(
4459 buf: &'a [u8],
4460 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4461 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
4462 }
4463 fn decode_view_with_limit(
4464 buf: &'a [u8],
4465 depth: u32,
4466 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4467 Self::_decode_depth(buf, depth)
4468 }
4469 fn to_owned_message(&self) -> super::super::ListRecipientsResponse {
4470 self.to_owned_from_source(None)
4471 }
4472 #[allow(clippy::useless_conversion, clippy::needless_update)]
4473 fn to_owned_from_source(
4474 &self,
4475 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4476 ) -> super::super::ListRecipientsResponse {
4477 #[allow(unused_imports)]
4478 use ::buffa::alloc::string::ToString as _;
4479 let _ = __buffa_src;
4480 super::super::ListRecipientsResponse {
4481 recipients: self
4482 .recipients
4483 .iter()
4484 .map(|v| v.to_owned_from_source(__buffa_src))
4485 .collect(),
4486 next_page_token: self.next_page_token.map(|s| s.to_string()),
4487 __buffa_unknown_fields: self
4488 .__buffa_unknown_fields
4489 .to_owned()
4490 .unwrap_or_default()
4491 .into(),
4492 ..::core::default::Default::default()
4493 }
4494 }
4495 }
4496 impl<'a> ::buffa::ViewEncode<'a> for ListRecipientsResponseView<'a> {
4497 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4498 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4499 #[allow(unused_imports)]
4500 use ::buffa::Enumeration as _;
4501 let mut size = 0u32;
4502 for v in &self.recipients {
4503 let __slot = __cache.reserve();
4504 let inner_size = v.compute_size(__cache);
4505 __cache.set(__slot, inner_size);
4506 size
4507 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4508 + inner_size;
4509 }
4510 if let Some(ref v) = self.next_page_token {
4511 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4512 }
4513 size += self.__buffa_unknown_fields.encoded_len() as u32;
4514 size
4515 }
4516 #[allow(clippy::needless_borrow)]
4517 fn write_to(
4518 &self,
4519 __cache: &mut ::buffa::SizeCache,
4520 buf: &mut impl ::buffa::bytes::BufMut,
4521 ) {
4522 #[allow(unused_imports)]
4523 use ::buffa::Enumeration as _;
4524 for v in &self.recipients {
4525 ::buffa::encoding::Tag::new(
4526 1u32,
4527 ::buffa::encoding::WireType::LengthDelimited,
4528 )
4529 .encode(buf);
4530 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
4531 v.write_to(__cache, buf);
4532 }
4533 if let Some(ref v) = self.next_page_token {
4534 ::buffa::encoding::Tag::new(
4535 2u32,
4536 ::buffa::encoding::WireType::LengthDelimited,
4537 )
4538 .encode(buf);
4539 ::buffa::types::encode_string(v, buf);
4540 }
4541 self.__buffa_unknown_fields.write_to(buf);
4542 }
4543 }
4544 impl<'__a> ::serde::Serialize for ListRecipientsResponseView<'__a> {
4556 fn serialize<__S: ::serde::Serializer>(
4557 &self,
4558 __s: __S,
4559 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4560 use ::serde::ser::SerializeMap as _;
4561 let mut __map = __s.serialize_map(::core::option::Option::None)?;
4562 if !self.recipients.is_empty() {
4563 __map.serialize_entry("recipients", &*self.recipients)?;
4564 }
4565 if let ::core::option::Option::Some(__v) = self.next_page_token {
4566 __map.serialize_entry("next_page_token", __v)?;
4567 }
4568 __map.end()
4569 }
4570 }
4571 impl<'a> ::buffa::MessageName for ListRecipientsResponseView<'a> {
4572 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
4573 const NAME: &'static str = "ListRecipientsResponse";
4574 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.ListRecipientsResponse";
4575 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.ListRecipientsResponse";
4576 }
4577 impl<'v> ::buffa::DefaultViewInstance for ListRecipientsResponseView<'v> {
4578 fn default_view_instance<'a>() -> &'a Self
4579 where
4580 Self: 'a,
4581 {
4582 static VALUE: ::buffa::__private::OnceBox<
4583 ListRecipientsResponseView<'static>,
4584 > = ::buffa::__private::OnceBox::new();
4585 VALUE
4586 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
4587 <ListRecipientsResponseView<'static>>::default(),
4588 ))
4589 }
4590 }
4591 impl ::buffa::ViewReborrow for ListRecipientsResponseView<'static> {
4592 type Reborrowed<'b> = ListRecipientsResponseView<'b>;
4593 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
4594 this
4595 }
4596 }
4597 #[derive(Clone, Debug)]
4603 pub struct ListRecipientsResponseOwnedView(
4604 ::buffa::OwnedView<ListRecipientsResponseView<'static>>,
4605 );
4606 impl ListRecipientsResponseOwnedView {
4607 pub fn decode(
4617 bytes: ::buffa::bytes::Bytes,
4618 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4619 ::core::result::Result::Ok(
4620 ListRecipientsResponseOwnedView(::buffa::OwnedView::decode(bytes)?),
4621 )
4622 }
4623 pub fn decode_with_options(
4631 bytes: ::buffa::bytes::Bytes,
4632 opts: &::buffa::DecodeOptions,
4633 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4634 ::core::result::Result::Ok(
4635 ListRecipientsResponseOwnedView(
4636 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4637 ),
4638 )
4639 }
4640 pub fn from_owned(
4647 msg: &super::super::ListRecipientsResponse,
4648 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4649 ::core::result::Result::Ok(
4650 ListRecipientsResponseOwnedView(::buffa::OwnedView::from_owned(msg)?),
4651 )
4652 }
4653 #[must_use]
4655 pub fn view(&self) -> &ListRecipientsResponseView<'_> {
4656 self.0.reborrow()
4657 }
4658 #[must_use]
4660 pub fn to_owned_message(&self) -> super::super::ListRecipientsResponse {
4661 self.0.to_owned_message()
4662 }
4663 #[must_use]
4665 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4666 self.0.bytes()
4667 }
4668 #[must_use]
4670 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4671 self.0.into_bytes()
4672 }
4673 #[must_use]
4677 pub fn recipients(
4678 &self,
4679 ) -> &::buffa::RepeatedView<
4680 '_,
4681 super::super::__buffa::view::RecipientView<'_>,
4682 > {
4683 &self.0.reborrow().recipients
4684 }
4685 #[must_use]
4689 pub fn next_page_token(&self) -> ::core::option::Option<&'_ str> {
4690 self.0.reborrow().next_page_token
4691 }
4692 }
4693 impl ::core::convert::From<
4694 ::buffa::OwnedView<ListRecipientsResponseView<'static>>,
4695 > for ListRecipientsResponseOwnedView {
4696 fn from(
4697 inner: ::buffa::OwnedView<ListRecipientsResponseView<'static>>,
4698 ) -> Self {
4699 ListRecipientsResponseOwnedView(inner)
4700 }
4701 }
4702 impl ::core::convert::From<ListRecipientsResponseOwnedView>
4703 for ::buffa::OwnedView<ListRecipientsResponseView<'static>> {
4704 fn from(wrapper: ListRecipientsResponseOwnedView) -> Self {
4705 wrapper.0
4706 }
4707 }
4708 impl ::core::convert::AsRef<
4709 ::buffa::OwnedView<ListRecipientsResponseView<'static>>,
4710 > for ListRecipientsResponseOwnedView {
4711 fn as_ref(
4712 &self,
4713 ) -> &::buffa::OwnedView<ListRecipientsResponseView<'static>> {
4714 &self.0
4715 }
4716 }
4717 impl ::buffa::HasMessageView for super::super::ListRecipientsResponse {
4718 type View<'a> = ListRecipientsResponseView<'a>;
4719 type ViewHandle = ListRecipientsResponseOwnedView;
4720 }
4721 impl ::serde::Serialize for ListRecipientsResponseOwnedView {
4722 fn serialize<__S: ::serde::Serializer>(
4723 &self,
4724 __s: __S,
4725 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4726 ::serde::Serialize::serialize(&self.0, __s)
4727 }
4728 }
4729 #[derive(Clone, Debug, Default)]
4731 pub struct CreateRecipientRequestView<'a> {
4732 pub name: &'a str,
4736 pub authentication_type: ::buffa::EnumValue<
4740 super::super::AuthenticationType,
4741 >,
4742 pub owner: &'a str,
4746 pub comment: ::core::option::Option<&'a str>,
4750 pub properties: ::buffa::MapView<'a, &'a str, &'a str>,
4757 pub expiration_time: ::core::option::Option<i64>,
4761 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4762 }
4763 impl<'a> CreateRecipientRequestView<'a> {
4764 #[doc(hidden)]
4772 pub fn _decode_depth(
4773 buf: &'a [u8],
4774 depth: u32,
4775 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4776 let mut view = Self::default();
4777 view._merge_into_view(buf, depth)?;
4778 ::core::result::Result::Ok(view)
4779 }
4780 #[doc(hidden)]
4788 pub fn _merge_into_view(
4789 &mut self,
4790 buf: &'a [u8],
4791 depth: u32,
4792 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4793 let _ = depth;
4794 #[allow(unused_variables)]
4795 let view = self;
4796 let mut cur: &'a [u8] = buf;
4797 while !cur.is_empty() {
4798 let before_tag = cur;
4799 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
4800 match tag.field_number() {
4801 1u32 => {
4802 if tag.wire_type()
4803 != ::buffa::encoding::WireType::LengthDelimited
4804 {
4805 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4806 field_number: 1u32,
4807 expected: 2u8,
4808 actual: tag.wire_type() as u8,
4809 });
4810 }
4811 view.name = ::buffa::types::borrow_str(&mut cur)?;
4812 }
4813 2u32 => {
4814 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4815 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4816 field_number: 2u32,
4817 expected: 0u8,
4818 actual: tag.wire_type() as u8,
4819 });
4820 }
4821 view.authentication_type = ::buffa::EnumValue::from(
4822 ::buffa::types::decode_int32(&mut cur)?,
4823 );
4824 }
4825 3u32 => {
4826 if tag.wire_type()
4827 != ::buffa::encoding::WireType::LengthDelimited
4828 {
4829 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4830 field_number: 3u32,
4831 expected: 2u8,
4832 actual: tag.wire_type() as u8,
4833 });
4834 }
4835 view.owner = ::buffa::types::borrow_str(&mut cur)?;
4836 }
4837 4u32 => {
4838 if tag.wire_type()
4839 != ::buffa::encoding::WireType::LengthDelimited
4840 {
4841 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4842 field_number: 4u32,
4843 expected: 2u8,
4844 actual: tag.wire_type() as u8,
4845 });
4846 }
4847 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
4848 }
4849 6u32 => {
4850 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4851 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4852 field_number: 6u32,
4853 expected: 0u8,
4854 actual: tag.wire_type() as u8,
4855 });
4856 }
4857 view.expiration_time = Some(
4858 ::buffa::types::decode_int64(&mut cur)?,
4859 );
4860 }
4861 5u32 => {
4862 if tag.wire_type()
4863 != ::buffa::encoding::WireType::LengthDelimited
4864 {
4865 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4866 field_number: 5u32,
4867 expected: 2u8,
4868 actual: tag.wire_type() as u8,
4869 });
4870 }
4871 let entry_bytes = ::buffa::types::borrow_bytes(&mut cur)?;
4872 let mut entry_cur: &'a [u8] = entry_bytes;
4873 let mut key = "";
4874 let mut val = "";
4875 while !entry_cur.is_empty() {
4876 let entry_tag = ::buffa::encoding::Tag::decode(
4877 &mut entry_cur,
4878 )?;
4879 match entry_tag.field_number() {
4880 1 => {
4881 if entry_tag.wire_type()
4882 != ::buffa::encoding::WireType::LengthDelimited
4883 {
4884 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4885 field_number: entry_tag.field_number(),
4886 expected: 2u8,
4887 actual: entry_tag.wire_type() as u8,
4888 });
4889 }
4890 key = ::buffa::types::borrow_str(&mut entry_cur)?;
4891 }
4892 2 => {
4893 if entry_tag.wire_type()
4894 != ::buffa::encoding::WireType::LengthDelimited
4895 {
4896 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4897 field_number: entry_tag.field_number(),
4898 expected: 2u8,
4899 actual: entry_tag.wire_type() as u8,
4900 });
4901 }
4902 val = ::buffa::types::borrow_str(&mut entry_cur)?;
4903 }
4904 _ => {
4905 ::buffa::encoding::skip_field_depth(
4906 entry_tag,
4907 &mut entry_cur,
4908 depth,
4909 )?;
4910 }
4911 }
4912 }
4913 view.properties.push(key, val);
4914 }
4915 _ => {
4916 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4917 let span_len = before_tag.len() - cur.len();
4918 view.__buffa_unknown_fields
4919 .push_raw(&before_tag[..span_len]);
4920 }
4921 }
4922 }
4923 ::core::result::Result::Ok(())
4924 }
4925 }
4926 impl<'a> ::buffa::MessageView<'a> for CreateRecipientRequestView<'a> {
4927 type Owned = super::super::CreateRecipientRequest;
4928 fn decode_view(
4929 buf: &'a [u8],
4930 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4931 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
4932 }
4933 fn decode_view_with_limit(
4934 buf: &'a [u8],
4935 depth: u32,
4936 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4937 Self::_decode_depth(buf, depth)
4938 }
4939 fn to_owned_message(&self) -> super::super::CreateRecipientRequest {
4940 self.to_owned_from_source(None)
4941 }
4942 #[allow(clippy::useless_conversion, clippy::needless_update)]
4943 fn to_owned_from_source(
4944 &self,
4945 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4946 ) -> super::super::CreateRecipientRequest {
4947 #[allow(unused_imports)]
4948 use ::buffa::alloc::string::ToString as _;
4949 let _ = __buffa_src;
4950 super::super::CreateRecipientRequest {
4951 name: self.name.to_string(),
4952 authentication_type: self.authentication_type,
4953 owner: self.owner.to_string(),
4954 comment: self.comment.map(|s| s.to_string()),
4955 properties: self
4956 .properties
4957 .iter()
4958 .map(|(k, v)| (k.to_string(), v.to_string()))
4959 .collect(),
4960 expiration_time: self.expiration_time,
4961 __buffa_unknown_fields: self
4962 .__buffa_unknown_fields
4963 .to_owned()
4964 .unwrap_or_default()
4965 .into(),
4966 ..::core::default::Default::default()
4967 }
4968 }
4969 }
4970 impl<'a> ::buffa::ViewEncode<'a> for CreateRecipientRequestView<'a> {
4971 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4972 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
4973 #[allow(unused_imports)]
4974 use ::buffa::Enumeration as _;
4975 let mut size = 0u32;
4976 if !self.name.is_empty() {
4977 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
4978 }
4979 {
4980 let val = self.authentication_type.to_i32();
4981 if val != 0 {
4982 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
4983 }
4984 }
4985 if !self.owner.is_empty() {
4986 size
4987 += 1u32 + ::buffa::types::string_encoded_len(&self.owner) as u32;
4988 }
4989 if let Some(ref v) = self.comment {
4990 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4991 }
4992 #[allow(clippy::for_kv_map)]
4993 for (k, v) in &self.properties {
4994 let entry_size: u32 = 1u32
4995 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
4996 + ::buffa::types::string_encoded_len(v) as u32;
4997 size
4998 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
4999 + entry_size;
5000 }
5001 if let Some(v) = self.expiration_time {
5002 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
5003 }
5004 size += self.__buffa_unknown_fields.encoded_len() as u32;
5005 size
5006 }
5007 #[allow(clippy::needless_borrow)]
5008 fn write_to(
5009 &self,
5010 _cache: &mut ::buffa::SizeCache,
5011 buf: &mut impl ::buffa::bytes::BufMut,
5012 ) {
5013 #[allow(unused_imports)]
5014 use ::buffa::Enumeration as _;
5015 if !self.name.is_empty() {
5016 ::buffa::encoding::Tag::new(
5017 1u32,
5018 ::buffa::encoding::WireType::LengthDelimited,
5019 )
5020 .encode(buf);
5021 ::buffa::types::encode_string(&self.name, buf);
5022 }
5023 {
5024 let val = self.authentication_type.to_i32();
5025 if val != 0 {
5026 ::buffa::encoding::Tag::new(
5027 2u32,
5028 ::buffa::encoding::WireType::Varint,
5029 )
5030 .encode(buf);
5031 ::buffa::types::encode_int32(val, buf);
5032 }
5033 }
5034 if !self.owner.is_empty() {
5035 ::buffa::encoding::Tag::new(
5036 3u32,
5037 ::buffa::encoding::WireType::LengthDelimited,
5038 )
5039 .encode(buf);
5040 ::buffa::types::encode_string(&self.owner, buf);
5041 }
5042 if let Some(ref v) = self.comment {
5043 ::buffa::encoding::Tag::new(
5044 4u32,
5045 ::buffa::encoding::WireType::LengthDelimited,
5046 )
5047 .encode(buf);
5048 ::buffa::types::encode_string(v, buf);
5049 }
5050 for (k, v) in &self.properties {
5051 let entry_size: u32 = 1u32
5052 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
5053 + ::buffa::types::string_encoded_len(v) as u32;
5054 ::buffa::encoding::Tag::new(
5055 5u32,
5056 ::buffa::encoding::WireType::LengthDelimited,
5057 )
5058 .encode(buf);
5059 ::buffa::encoding::encode_varint(entry_size as u64, buf);
5060 ::buffa::encoding::Tag::new(
5061 1u32,
5062 ::buffa::encoding::WireType::LengthDelimited,
5063 )
5064 .encode(buf);
5065 ::buffa::types::encode_string(k, buf);
5066 ::buffa::encoding::Tag::new(
5067 2u32,
5068 ::buffa::encoding::WireType::LengthDelimited,
5069 )
5070 .encode(buf);
5071 ::buffa::types::encode_string(v, buf);
5072 }
5073 if let Some(v) = self.expiration_time {
5074 ::buffa::encoding::Tag::new(
5075 6u32,
5076 ::buffa::encoding::WireType::Varint,
5077 )
5078 .encode(buf);
5079 ::buffa::types::encode_int64(v, buf);
5080 }
5081 self.__buffa_unknown_fields.write_to(buf);
5082 }
5083 }
5084 impl<'__a> ::serde::Serialize for CreateRecipientRequestView<'__a> {
5096 fn serialize<__S: ::serde::Serializer>(
5097 &self,
5098 __s: __S,
5099 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5100 use ::serde::ser::SerializeMap as _;
5101 let mut __map = __s.serialize_map(::core::option::Option::None)?;
5102 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
5103 __map.serialize_entry("name", self.name)?;
5104 }
5105 if !::buffa::json_helpers::skip_if::is_default_enum_value(
5106 &self.authentication_type,
5107 ) {
5108 __map
5109 .serialize_entry(
5110 "authenticationType",
5111 &self.authentication_type,
5112 )?;
5113 }
5114 if !::buffa::json_helpers::skip_if::is_empty_str(self.owner) {
5115 __map.serialize_entry("owner", self.owner)?;
5116 }
5117 if let ::core::option::Option::Some(__v) = self.comment {
5118 __map.serialize_entry("comment", __v)?;
5119 }
5120 if !self.properties.is_empty() {
5121 struct _WM<'__a, '__x>(
5122 &'__x ::buffa::MapView<'__x, &'__a str, &'__a str>,
5123 );
5124 impl<'__a> ::serde::Serialize for _WM<'__a, '_> {
5125 fn serialize<__S: ::serde::Serializer>(
5126 &self,
5127 __s: __S,
5128 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5129 use ::serde::ser::SerializeMap as _;
5130 let mut __m = __s
5131 .serialize_map(::core::option::Option::Some(self.0.len()))?;
5132 for (k, v) in self.0.iter_unique() {
5133 __m.serialize_entry(k, v)?;
5134 }
5135 __m.end()
5136 }
5137 }
5138 __map.serialize_entry("properties", &_WM(&self.properties))?;
5139 }
5140 if let ::core::option::Option::Some(__v) = self.expiration_time {
5141 struct _W(i64);
5142 impl ::serde::Serialize for _W {
5143 fn serialize<__S: ::serde::Serializer>(
5144 &self,
5145 __s: __S,
5146 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5147 ::buffa::json_helpers::int64::serialize(&self.0, __s)
5148 }
5149 }
5150 __map.serialize_entry("expiration_time", &_W(__v))?;
5151 }
5152 __map.end()
5153 }
5154 }
5155 impl<'a> ::buffa::MessageName for CreateRecipientRequestView<'a> {
5156 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
5157 const NAME: &'static str = "CreateRecipientRequest";
5158 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.CreateRecipientRequest";
5159 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.CreateRecipientRequest";
5160 }
5161 impl<'v> ::buffa::DefaultViewInstance for CreateRecipientRequestView<'v> {
5162 fn default_view_instance<'a>() -> &'a Self
5163 where
5164 Self: 'a,
5165 {
5166 static VALUE: ::buffa::__private::OnceBox<
5167 CreateRecipientRequestView<'static>,
5168 > = ::buffa::__private::OnceBox::new();
5169 VALUE
5170 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
5171 <CreateRecipientRequestView<'static>>::default(),
5172 ))
5173 }
5174 }
5175 impl ::buffa::ViewReborrow for CreateRecipientRequestView<'static> {
5176 type Reborrowed<'b> = CreateRecipientRequestView<'b>;
5177 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
5178 this
5179 }
5180 }
5181 #[derive(Clone, Debug)]
5187 pub struct CreateRecipientRequestOwnedView(
5188 ::buffa::OwnedView<CreateRecipientRequestView<'static>>,
5189 );
5190 impl CreateRecipientRequestOwnedView {
5191 pub fn decode(
5201 bytes: ::buffa::bytes::Bytes,
5202 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5203 ::core::result::Result::Ok(
5204 CreateRecipientRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
5205 )
5206 }
5207 pub fn decode_with_options(
5215 bytes: ::buffa::bytes::Bytes,
5216 opts: &::buffa::DecodeOptions,
5217 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5218 ::core::result::Result::Ok(
5219 CreateRecipientRequestOwnedView(
5220 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5221 ),
5222 )
5223 }
5224 pub fn from_owned(
5231 msg: &super::super::CreateRecipientRequest,
5232 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5233 ::core::result::Result::Ok(
5234 CreateRecipientRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
5235 )
5236 }
5237 #[must_use]
5239 pub fn view(&self) -> &CreateRecipientRequestView<'_> {
5240 self.0.reborrow()
5241 }
5242 #[must_use]
5244 pub fn to_owned_message(&self) -> super::super::CreateRecipientRequest {
5245 self.0.to_owned_message()
5246 }
5247 #[must_use]
5249 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5250 self.0.bytes()
5251 }
5252 #[must_use]
5254 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5255 self.0.into_bytes()
5256 }
5257 #[must_use]
5261 pub fn name(&self) -> &'_ str {
5262 self.0.reborrow().name
5263 }
5264 #[must_use]
5268 pub fn authentication_type(
5269 &self,
5270 ) -> ::buffa::EnumValue<super::super::AuthenticationType> {
5271 self.0.reborrow().authentication_type
5272 }
5273 #[must_use]
5277 pub fn owner(&self) -> &'_ str {
5278 self.0.reborrow().owner
5279 }
5280 #[must_use]
5284 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
5285 self.0.reborrow().comment
5286 }
5287 #[must_use]
5294 pub fn properties(&self) -> &::buffa::MapView<'_, &'_ str, &'_ str> {
5295 &self.0.reborrow().properties
5296 }
5297 #[must_use]
5301 pub fn expiration_time(&self) -> ::core::option::Option<i64> {
5302 self.0.reborrow().expiration_time
5303 }
5304 }
5305 impl ::core::convert::From<
5306 ::buffa::OwnedView<CreateRecipientRequestView<'static>>,
5307 > for CreateRecipientRequestOwnedView {
5308 fn from(
5309 inner: ::buffa::OwnedView<CreateRecipientRequestView<'static>>,
5310 ) -> Self {
5311 CreateRecipientRequestOwnedView(inner)
5312 }
5313 }
5314 impl ::core::convert::From<CreateRecipientRequestOwnedView>
5315 for ::buffa::OwnedView<CreateRecipientRequestView<'static>> {
5316 fn from(wrapper: CreateRecipientRequestOwnedView) -> Self {
5317 wrapper.0
5318 }
5319 }
5320 impl ::core::convert::AsRef<
5321 ::buffa::OwnedView<CreateRecipientRequestView<'static>>,
5322 > for CreateRecipientRequestOwnedView {
5323 fn as_ref(
5324 &self,
5325 ) -> &::buffa::OwnedView<CreateRecipientRequestView<'static>> {
5326 &self.0
5327 }
5328 }
5329 impl ::buffa::HasMessageView for super::super::CreateRecipientRequest {
5330 type View<'a> = CreateRecipientRequestView<'a>;
5331 type ViewHandle = CreateRecipientRequestOwnedView;
5332 }
5333 impl ::serde::Serialize for CreateRecipientRequestOwnedView {
5334 fn serialize<__S: ::serde::Serializer>(
5335 &self,
5336 __s: __S,
5337 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5338 ::serde::Serialize::serialize(&self.0, __s)
5339 }
5340 }
5341 #[derive(Clone, Debug, Default)]
5343 pub struct GetRecipientRequestView<'a> {
5344 pub name: &'a str,
5348 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
5349 }
5350 impl<'a> GetRecipientRequestView<'a> {
5351 #[doc(hidden)]
5359 pub fn _decode_depth(
5360 buf: &'a [u8],
5361 depth: u32,
5362 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5363 let mut view = Self::default();
5364 view._merge_into_view(buf, depth)?;
5365 ::core::result::Result::Ok(view)
5366 }
5367 #[doc(hidden)]
5375 pub fn _merge_into_view(
5376 &mut self,
5377 buf: &'a [u8],
5378 depth: u32,
5379 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5380 let _ = depth;
5381 #[allow(unused_variables)]
5382 let view = self;
5383 let mut cur: &'a [u8] = buf;
5384 while !cur.is_empty() {
5385 let before_tag = cur;
5386 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
5387 match tag.field_number() {
5388 1u32 => {
5389 if tag.wire_type()
5390 != ::buffa::encoding::WireType::LengthDelimited
5391 {
5392 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5393 field_number: 1u32,
5394 expected: 2u8,
5395 actual: tag.wire_type() as u8,
5396 });
5397 }
5398 view.name = ::buffa::types::borrow_str(&mut cur)?;
5399 }
5400 _ => {
5401 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
5402 let span_len = before_tag.len() - cur.len();
5403 view.__buffa_unknown_fields
5404 .push_raw(&before_tag[..span_len]);
5405 }
5406 }
5407 }
5408 ::core::result::Result::Ok(())
5409 }
5410 }
5411 impl<'a> ::buffa::MessageView<'a> for GetRecipientRequestView<'a> {
5412 type Owned = super::super::GetRecipientRequest;
5413 fn decode_view(
5414 buf: &'a [u8],
5415 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5416 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
5417 }
5418 fn decode_view_with_limit(
5419 buf: &'a [u8],
5420 depth: u32,
5421 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5422 Self::_decode_depth(buf, depth)
5423 }
5424 fn to_owned_message(&self) -> super::super::GetRecipientRequest {
5425 self.to_owned_from_source(None)
5426 }
5427 #[allow(clippy::useless_conversion, clippy::needless_update)]
5428 fn to_owned_from_source(
5429 &self,
5430 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
5431 ) -> super::super::GetRecipientRequest {
5432 #[allow(unused_imports)]
5433 use ::buffa::alloc::string::ToString as _;
5434 let _ = __buffa_src;
5435 super::super::GetRecipientRequest {
5436 name: self.name.to_string(),
5437 __buffa_unknown_fields: self
5438 .__buffa_unknown_fields
5439 .to_owned()
5440 .unwrap_or_default()
5441 .into(),
5442 ..::core::default::Default::default()
5443 }
5444 }
5445 }
5446 impl<'a> ::buffa::ViewEncode<'a> for GetRecipientRequestView<'a> {
5447 #[allow(clippy::needless_borrow, clippy::let_and_return)]
5448 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5449 #[allow(unused_imports)]
5450 use ::buffa::Enumeration as _;
5451 let mut size = 0u32;
5452 if !self.name.is_empty() {
5453 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
5454 }
5455 size += self.__buffa_unknown_fields.encoded_len() as u32;
5456 size
5457 }
5458 #[allow(clippy::needless_borrow)]
5459 fn write_to(
5460 &self,
5461 _cache: &mut ::buffa::SizeCache,
5462 buf: &mut impl ::buffa::bytes::BufMut,
5463 ) {
5464 #[allow(unused_imports)]
5465 use ::buffa::Enumeration as _;
5466 if !self.name.is_empty() {
5467 ::buffa::encoding::Tag::new(
5468 1u32,
5469 ::buffa::encoding::WireType::LengthDelimited,
5470 )
5471 .encode(buf);
5472 ::buffa::types::encode_string(&self.name, buf);
5473 }
5474 self.__buffa_unknown_fields.write_to(buf);
5475 }
5476 }
5477 impl<'__a> ::serde::Serialize for GetRecipientRequestView<'__a> {
5489 fn serialize<__S: ::serde::Serializer>(
5490 &self,
5491 __s: __S,
5492 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5493 use ::serde::ser::SerializeMap as _;
5494 let mut __map = __s.serialize_map(::core::option::Option::None)?;
5495 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
5496 __map.serialize_entry("name", self.name)?;
5497 }
5498 __map.end()
5499 }
5500 }
5501 impl<'a> ::buffa::MessageName for GetRecipientRequestView<'a> {
5502 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
5503 const NAME: &'static str = "GetRecipientRequest";
5504 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.GetRecipientRequest";
5505 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.GetRecipientRequest";
5506 }
5507 impl<'v> ::buffa::DefaultViewInstance for GetRecipientRequestView<'v> {
5508 fn default_view_instance<'a>() -> &'a Self
5509 where
5510 Self: 'a,
5511 {
5512 static VALUE: ::buffa::__private::OnceBox<
5513 GetRecipientRequestView<'static>,
5514 > = ::buffa::__private::OnceBox::new();
5515 VALUE
5516 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
5517 <GetRecipientRequestView<'static>>::default(),
5518 ))
5519 }
5520 }
5521 impl ::buffa::ViewReborrow for GetRecipientRequestView<'static> {
5522 type Reborrowed<'b> = GetRecipientRequestView<'b>;
5523 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
5524 this
5525 }
5526 }
5527 #[derive(Clone, Debug)]
5533 pub struct GetRecipientRequestOwnedView(
5534 ::buffa::OwnedView<GetRecipientRequestView<'static>>,
5535 );
5536 impl GetRecipientRequestOwnedView {
5537 pub fn decode(
5547 bytes: ::buffa::bytes::Bytes,
5548 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5549 ::core::result::Result::Ok(
5550 GetRecipientRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
5551 )
5552 }
5553 pub fn decode_with_options(
5561 bytes: ::buffa::bytes::Bytes,
5562 opts: &::buffa::DecodeOptions,
5563 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5564 ::core::result::Result::Ok(
5565 GetRecipientRequestOwnedView(
5566 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5567 ),
5568 )
5569 }
5570 pub fn from_owned(
5577 msg: &super::super::GetRecipientRequest,
5578 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5579 ::core::result::Result::Ok(
5580 GetRecipientRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
5581 )
5582 }
5583 #[must_use]
5585 pub fn view(&self) -> &GetRecipientRequestView<'_> {
5586 self.0.reborrow()
5587 }
5588 #[must_use]
5590 pub fn to_owned_message(&self) -> super::super::GetRecipientRequest {
5591 self.0.to_owned_message()
5592 }
5593 #[must_use]
5595 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5596 self.0.bytes()
5597 }
5598 #[must_use]
5600 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5601 self.0.into_bytes()
5602 }
5603 #[must_use]
5607 pub fn name(&self) -> &'_ str {
5608 self.0.reborrow().name
5609 }
5610 }
5611 impl ::core::convert::From<::buffa::OwnedView<GetRecipientRequestView<'static>>>
5612 for GetRecipientRequestOwnedView {
5613 fn from(
5614 inner: ::buffa::OwnedView<GetRecipientRequestView<'static>>,
5615 ) -> Self {
5616 GetRecipientRequestOwnedView(inner)
5617 }
5618 }
5619 impl ::core::convert::From<GetRecipientRequestOwnedView>
5620 for ::buffa::OwnedView<GetRecipientRequestView<'static>> {
5621 fn from(wrapper: GetRecipientRequestOwnedView) -> Self {
5622 wrapper.0
5623 }
5624 }
5625 impl ::core::convert::AsRef<::buffa::OwnedView<GetRecipientRequestView<'static>>>
5626 for GetRecipientRequestOwnedView {
5627 fn as_ref(&self) -> &::buffa::OwnedView<GetRecipientRequestView<'static>> {
5628 &self.0
5629 }
5630 }
5631 impl ::buffa::HasMessageView for super::super::GetRecipientRequest {
5632 type View<'a> = GetRecipientRequestView<'a>;
5633 type ViewHandle = GetRecipientRequestOwnedView;
5634 }
5635 impl ::serde::Serialize for GetRecipientRequestOwnedView {
5636 fn serialize<__S: ::serde::Serializer>(
5637 &self,
5638 __s: __S,
5639 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5640 ::serde::Serialize::serialize(&self.0, __s)
5641 }
5642 }
5643 #[derive(Clone, Debug, Default)]
5645 pub struct UpdateRecipientRequestView<'a> {
5646 pub name: &'a str,
5650 pub new_name: ::core::option::Option<&'a str>,
5654 pub owner: ::core::option::Option<&'a str>,
5658 pub comment: ::core::option::Option<&'a str>,
5662 pub properties: ::buffa::MapView<'a, &'a str, &'a str>,
5669 pub expiration_time: ::core::option::Option<i64>,
5673 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
5674 }
5675 impl<'a> UpdateRecipientRequestView<'a> {
5676 #[doc(hidden)]
5684 pub fn _decode_depth(
5685 buf: &'a [u8],
5686 depth: u32,
5687 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5688 let mut view = Self::default();
5689 view._merge_into_view(buf, depth)?;
5690 ::core::result::Result::Ok(view)
5691 }
5692 #[doc(hidden)]
5700 pub fn _merge_into_view(
5701 &mut self,
5702 buf: &'a [u8],
5703 depth: u32,
5704 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5705 let _ = depth;
5706 #[allow(unused_variables)]
5707 let view = self;
5708 let mut cur: &'a [u8] = buf;
5709 while !cur.is_empty() {
5710 let before_tag = cur;
5711 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
5712 match tag.field_number() {
5713 1u32 => {
5714 if tag.wire_type()
5715 != ::buffa::encoding::WireType::LengthDelimited
5716 {
5717 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5718 field_number: 1u32,
5719 expected: 2u8,
5720 actual: tag.wire_type() as u8,
5721 });
5722 }
5723 view.name = ::buffa::types::borrow_str(&mut cur)?;
5724 }
5725 2u32 => {
5726 if tag.wire_type()
5727 != ::buffa::encoding::WireType::LengthDelimited
5728 {
5729 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5730 field_number: 2u32,
5731 expected: 2u8,
5732 actual: tag.wire_type() as u8,
5733 });
5734 }
5735 view.new_name = Some(::buffa::types::borrow_str(&mut cur)?);
5736 }
5737 3u32 => {
5738 if tag.wire_type()
5739 != ::buffa::encoding::WireType::LengthDelimited
5740 {
5741 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5742 field_number: 3u32,
5743 expected: 2u8,
5744 actual: tag.wire_type() as u8,
5745 });
5746 }
5747 view.owner = Some(::buffa::types::borrow_str(&mut cur)?);
5748 }
5749 4u32 => {
5750 if tag.wire_type()
5751 != ::buffa::encoding::WireType::LengthDelimited
5752 {
5753 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5754 field_number: 4u32,
5755 expected: 2u8,
5756 actual: tag.wire_type() as u8,
5757 });
5758 }
5759 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
5760 }
5761 6u32 => {
5762 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
5763 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5764 field_number: 6u32,
5765 expected: 0u8,
5766 actual: tag.wire_type() as u8,
5767 });
5768 }
5769 view.expiration_time = Some(
5770 ::buffa::types::decode_int64(&mut cur)?,
5771 );
5772 }
5773 5u32 => {
5774 if tag.wire_type()
5775 != ::buffa::encoding::WireType::LengthDelimited
5776 {
5777 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5778 field_number: 5u32,
5779 expected: 2u8,
5780 actual: tag.wire_type() as u8,
5781 });
5782 }
5783 let entry_bytes = ::buffa::types::borrow_bytes(&mut cur)?;
5784 let mut entry_cur: &'a [u8] = entry_bytes;
5785 let mut key = "";
5786 let mut val = "";
5787 while !entry_cur.is_empty() {
5788 let entry_tag = ::buffa::encoding::Tag::decode(
5789 &mut entry_cur,
5790 )?;
5791 match entry_tag.field_number() {
5792 1 => {
5793 if entry_tag.wire_type()
5794 != ::buffa::encoding::WireType::LengthDelimited
5795 {
5796 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5797 field_number: entry_tag.field_number(),
5798 expected: 2u8,
5799 actual: entry_tag.wire_type() as u8,
5800 });
5801 }
5802 key = ::buffa::types::borrow_str(&mut entry_cur)?;
5803 }
5804 2 => {
5805 if entry_tag.wire_type()
5806 != ::buffa::encoding::WireType::LengthDelimited
5807 {
5808 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5809 field_number: entry_tag.field_number(),
5810 expected: 2u8,
5811 actual: entry_tag.wire_type() as u8,
5812 });
5813 }
5814 val = ::buffa::types::borrow_str(&mut entry_cur)?;
5815 }
5816 _ => {
5817 ::buffa::encoding::skip_field_depth(
5818 entry_tag,
5819 &mut entry_cur,
5820 depth,
5821 )?;
5822 }
5823 }
5824 }
5825 view.properties.push(key, val);
5826 }
5827 _ => {
5828 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
5829 let span_len = before_tag.len() - cur.len();
5830 view.__buffa_unknown_fields
5831 .push_raw(&before_tag[..span_len]);
5832 }
5833 }
5834 }
5835 ::core::result::Result::Ok(())
5836 }
5837 }
5838 impl<'a> ::buffa::MessageView<'a> for UpdateRecipientRequestView<'a> {
5839 type Owned = super::super::UpdateRecipientRequest;
5840 fn decode_view(
5841 buf: &'a [u8],
5842 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5843 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
5844 }
5845 fn decode_view_with_limit(
5846 buf: &'a [u8],
5847 depth: u32,
5848 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5849 Self::_decode_depth(buf, depth)
5850 }
5851 fn to_owned_message(&self) -> super::super::UpdateRecipientRequest {
5852 self.to_owned_from_source(None)
5853 }
5854 #[allow(clippy::useless_conversion, clippy::needless_update)]
5855 fn to_owned_from_source(
5856 &self,
5857 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
5858 ) -> super::super::UpdateRecipientRequest {
5859 #[allow(unused_imports)]
5860 use ::buffa::alloc::string::ToString as _;
5861 let _ = __buffa_src;
5862 super::super::UpdateRecipientRequest {
5863 name: self.name.to_string(),
5864 new_name: self.new_name.map(|s| s.to_string()),
5865 owner: self.owner.map(|s| s.to_string()),
5866 comment: self.comment.map(|s| s.to_string()),
5867 properties: self
5868 .properties
5869 .iter()
5870 .map(|(k, v)| (k.to_string(), v.to_string()))
5871 .collect(),
5872 expiration_time: self.expiration_time,
5873 __buffa_unknown_fields: self
5874 .__buffa_unknown_fields
5875 .to_owned()
5876 .unwrap_or_default()
5877 .into(),
5878 ..::core::default::Default::default()
5879 }
5880 }
5881 }
5882 impl<'a> ::buffa::ViewEncode<'a> for UpdateRecipientRequestView<'a> {
5883 #[allow(clippy::needless_borrow, clippy::let_and_return)]
5884 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5885 #[allow(unused_imports)]
5886 use ::buffa::Enumeration as _;
5887 let mut size = 0u32;
5888 if !self.name.is_empty() {
5889 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
5890 }
5891 if let Some(ref v) = self.new_name {
5892 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5893 }
5894 if let Some(ref v) = self.owner {
5895 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5896 }
5897 if let Some(ref v) = self.comment {
5898 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5899 }
5900 #[allow(clippy::for_kv_map)]
5901 for (k, v) in &self.properties {
5902 let entry_size: u32 = 1u32
5903 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
5904 + ::buffa::types::string_encoded_len(v) as u32;
5905 size
5906 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
5907 + entry_size;
5908 }
5909 if let Some(v) = self.expiration_time {
5910 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
5911 }
5912 size += self.__buffa_unknown_fields.encoded_len() as u32;
5913 size
5914 }
5915 #[allow(clippy::needless_borrow)]
5916 fn write_to(
5917 &self,
5918 _cache: &mut ::buffa::SizeCache,
5919 buf: &mut impl ::buffa::bytes::BufMut,
5920 ) {
5921 #[allow(unused_imports)]
5922 use ::buffa::Enumeration as _;
5923 if !self.name.is_empty() {
5924 ::buffa::encoding::Tag::new(
5925 1u32,
5926 ::buffa::encoding::WireType::LengthDelimited,
5927 )
5928 .encode(buf);
5929 ::buffa::types::encode_string(&self.name, buf);
5930 }
5931 if let Some(ref v) = self.new_name {
5932 ::buffa::encoding::Tag::new(
5933 2u32,
5934 ::buffa::encoding::WireType::LengthDelimited,
5935 )
5936 .encode(buf);
5937 ::buffa::types::encode_string(v, buf);
5938 }
5939 if let Some(ref v) = self.owner {
5940 ::buffa::encoding::Tag::new(
5941 3u32,
5942 ::buffa::encoding::WireType::LengthDelimited,
5943 )
5944 .encode(buf);
5945 ::buffa::types::encode_string(v, buf);
5946 }
5947 if let Some(ref v) = self.comment {
5948 ::buffa::encoding::Tag::new(
5949 4u32,
5950 ::buffa::encoding::WireType::LengthDelimited,
5951 )
5952 .encode(buf);
5953 ::buffa::types::encode_string(v, buf);
5954 }
5955 for (k, v) in &self.properties {
5956 let entry_size: u32 = 1u32
5957 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
5958 + ::buffa::types::string_encoded_len(v) as u32;
5959 ::buffa::encoding::Tag::new(
5960 5u32,
5961 ::buffa::encoding::WireType::LengthDelimited,
5962 )
5963 .encode(buf);
5964 ::buffa::encoding::encode_varint(entry_size as u64, buf);
5965 ::buffa::encoding::Tag::new(
5966 1u32,
5967 ::buffa::encoding::WireType::LengthDelimited,
5968 )
5969 .encode(buf);
5970 ::buffa::types::encode_string(k, buf);
5971 ::buffa::encoding::Tag::new(
5972 2u32,
5973 ::buffa::encoding::WireType::LengthDelimited,
5974 )
5975 .encode(buf);
5976 ::buffa::types::encode_string(v, buf);
5977 }
5978 if let Some(v) = self.expiration_time {
5979 ::buffa::encoding::Tag::new(
5980 6u32,
5981 ::buffa::encoding::WireType::Varint,
5982 )
5983 .encode(buf);
5984 ::buffa::types::encode_int64(v, buf);
5985 }
5986 self.__buffa_unknown_fields.write_to(buf);
5987 }
5988 }
5989 impl<'__a> ::serde::Serialize for UpdateRecipientRequestView<'__a> {
6001 fn serialize<__S: ::serde::Serializer>(
6002 &self,
6003 __s: __S,
6004 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6005 use ::serde::ser::SerializeMap as _;
6006 let mut __map = __s.serialize_map(::core::option::Option::None)?;
6007 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
6008 __map.serialize_entry("name", self.name)?;
6009 }
6010 if let ::core::option::Option::Some(__v) = self.new_name {
6011 __map.serialize_entry("new_name", __v)?;
6012 }
6013 if let ::core::option::Option::Some(__v) = self.owner {
6014 __map.serialize_entry("owner", __v)?;
6015 }
6016 if let ::core::option::Option::Some(__v) = self.comment {
6017 __map.serialize_entry("comment", __v)?;
6018 }
6019 if !self.properties.is_empty() {
6020 struct _WM<'__a, '__x>(
6021 &'__x ::buffa::MapView<'__x, &'__a str, &'__a str>,
6022 );
6023 impl<'__a> ::serde::Serialize for _WM<'__a, '_> {
6024 fn serialize<__S: ::serde::Serializer>(
6025 &self,
6026 __s: __S,
6027 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6028 use ::serde::ser::SerializeMap as _;
6029 let mut __m = __s
6030 .serialize_map(::core::option::Option::Some(self.0.len()))?;
6031 for (k, v) in self.0.iter_unique() {
6032 __m.serialize_entry(k, v)?;
6033 }
6034 __m.end()
6035 }
6036 }
6037 __map.serialize_entry("properties", &_WM(&self.properties))?;
6038 }
6039 if let ::core::option::Option::Some(__v) = self.expiration_time {
6040 struct _W(i64);
6041 impl ::serde::Serialize for _W {
6042 fn serialize<__S: ::serde::Serializer>(
6043 &self,
6044 __s: __S,
6045 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6046 ::buffa::json_helpers::int64::serialize(&self.0, __s)
6047 }
6048 }
6049 __map.serialize_entry("expiration_time", &_W(__v))?;
6050 }
6051 __map.end()
6052 }
6053 }
6054 impl<'a> ::buffa::MessageName for UpdateRecipientRequestView<'a> {
6055 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
6056 const NAME: &'static str = "UpdateRecipientRequest";
6057 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.UpdateRecipientRequest";
6058 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.UpdateRecipientRequest";
6059 }
6060 impl<'v> ::buffa::DefaultViewInstance for UpdateRecipientRequestView<'v> {
6061 fn default_view_instance<'a>() -> &'a Self
6062 where
6063 Self: 'a,
6064 {
6065 static VALUE: ::buffa::__private::OnceBox<
6066 UpdateRecipientRequestView<'static>,
6067 > = ::buffa::__private::OnceBox::new();
6068 VALUE
6069 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
6070 <UpdateRecipientRequestView<'static>>::default(),
6071 ))
6072 }
6073 }
6074 impl ::buffa::ViewReborrow for UpdateRecipientRequestView<'static> {
6075 type Reborrowed<'b> = UpdateRecipientRequestView<'b>;
6076 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
6077 this
6078 }
6079 }
6080 #[derive(Clone, Debug)]
6086 pub struct UpdateRecipientRequestOwnedView(
6087 ::buffa::OwnedView<UpdateRecipientRequestView<'static>>,
6088 );
6089 impl UpdateRecipientRequestOwnedView {
6090 pub fn decode(
6100 bytes: ::buffa::bytes::Bytes,
6101 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6102 ::core::result::Result::Ok(
6103 UpdateRecipientRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
6104 )
6105 }
6106 pub fn decode_with_options(
6114 bytes: ::buffa::bytes::Bytes,
6115 opts: &::buffa::DecodeOptions,
6116 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6117 ::core::result::Result::Ok(
6118 UpdateRecipientRequestOwnedView(
6119 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
6120 ),
6121 )
6122 }
6123 pub fn from_owned(
6130 msg: &super::super::UpdateRecipientRequest,
6131 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6132 ::core::result::Result::Ok(
6133 UpdateRecipientRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
6134 )
6135 }
6136 #[must_use]
6138 pub fn view(&self) -> &UpdateRecipientRequestView<'_> {
6139 self.0.reborrow()
6140 }
6141 #[must_use]
6143 pub fn to_owned_message(&self) -> super::super::UpdateRecipientRequest {
6144 self.0.to_owned_message()
6145 }
6146 #[must_use]
6148 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
6149 self.0.bytes()
6150 }
6151 #[must_use]
6153 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
6154 self.0.into_bytes()
6155 }
6156 #[must_use]
6160 pub fn name(&self) -> &'_ str {
6161 self.0.reborrow().name
6162 }
6163 #[must_use]
6167 pub fn new_name(&self) -> ::core::option::Option<&'_ str> {
6168 self.0.reborrow().new_name
6169 }
6170 #[must_use]
6174 pub fn owner(&self) -> ::core::option::Option<&'_ str> {
6175 self.0.reborrow().owner
6176 }
6177 #[must_use]
6181 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
6182 self.0.reborrow().comment
6183 }
6184 #[must_use]
6191 pub fn properties(&self) -> &::buffa::MapView<'_, &'_ str, &'_ str> {
6192 &self.0.reborrow().properties
6193 }
6194 #[must_use]
6198 pub fn expiration_time(&self) -> ::core::option::Option<i64> {
6199 self.0.reborrow().expiration_time
6200 }
6201 }
6202 impl ::core::convert::From<
6203 ::buffa::OwnedView<UpdateRecipientRequestView<'static>>,
6204 > for UpdateRecipientRequestOwnedView {
6205 fn from(
6206 inner: ::buffa::OwnedView<UpdateRecipientRequestView<'static>>,
6207 ) -> Self {
6208 UpdateRecipientRequestOwnedView(inner)
6209 }
6210 }
6211 impl ::core::convert::From<UpdateRecipientRequestOwnedView>
6212 for ::buffa::OwnedView<UpdateRecipientRequestView<'static>> {
6213 fn from(wrapper: UpdateRecipientRequestOwnedView) -> Self {
6214 wrapper.0
6215 }
6216 }
6217 impl ::core::convert::AsRef<
6218 ::buffa::OwnedView<UpdateRecipientRequestView<'static>>,
6219 > for UpdateRecipientRequestOwnedView {
6220 fn as_ref(
6221 &self,
6222 ) -> &::buffa::OwnedView<UpdateRecipientRequestView<'static>> {
6223 &self.0
6224 }
6225 }
6226 impl ::buffa::HasMessageView for super::super::UpdateRecipientRequest {
6227 type View<'a> = UpdateRecipientRequestView<'a>;
6228 type ViewHandle = UpdateRecipientRequestOwnedView;
6229 }
6230 impl ::serde::Serialize for UpdateRecipientRequestOwnedView {
6231 fn serialize<__S: ::serde::Serializer>(
6232 &self,
6233 __s: __S,
6234 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6235 ::serde::Serialize::serialize(&self.0, __s)
6236 }
6237 }
6238 #[derive(Clone, Debug, Default)]
6240 pub struct DeleteRecipientRequestView<'a> {
6241 pub name: &'a str,
6245 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
6246 }
6247 impl<'a> DeleteRecipientRequestView<'a> {
6248 #[doc(hidden)]
6256 pub fn _decode_depth(
6257 buf: &'a [u8],
6258 depth: u32,
6259 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6260 let mut view = Self::default();
6261 view._merge_into_view(buf, depth)?;
6262 ::core::result::Result::Ok(view)
6263 }
6264 #[doc(hidden)]
6272 pub fn _merge_into_view(
6273 &mut self,
6274 buf: &'a [u8],
6275 depth: u32,
6276 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6277 let _ = depth;
6278 #[allow(unused_variables)]
6279 let view = self;
6280 let mut cur: &'a [u8] = buf;
6281 while !cur.is_empty() {
6282 let before_tag = cur;
6283 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
6284 match tag.field_number() {
6285 1u32 => {
6286 if tag.wire_type()
6287 != ::buffa::encoding::WireType::LengthDelimited
6288 {
6289 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6290 field_number: 1u32,
6291 expected: 2u8,
6292 actual: tag.wire_type() as u8,
6293 });
6294 }
6295 view.name = ::buffa::types::borrow_str(&mut cur)?;
6296 }
6297 _ => {
6298 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
6299 let span_len = before_tag.len() - cur.len();
6300 view.__buffa_unknown_fields
6301 .push_raw(&before_tag[..span_len]);
6302 }
6303 }
6304 }
6305 ::core::result::Result::Ok(())
6306 }
6307 }
6308 impl<'a> ::buffa::MessageView<'a> for DeleteRecipientRequestView<'a> {
6309 type Owned = super::super::DeleteRecipientRequest;
6310 fn decode_view(
6311 buf: &'a [u8],
6312 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6313 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
6314 }
6315 fn decode_view_with_limit(
6316 buf: &'a [u8],
6317 depth: u32,
6318 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6319 Self::_decode_depth(buf, depth)
6320 }
6321 fn to_owned_message(&self) -> super::super::DeleteRecipientRequest {
6322 self.to_owned_from_source(None)
6323 }
6324 #[allow(clippy::useless_conversion, clippy::needless_update)]
6325 fn to_owned_from_source(
6326 &self,
6327 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
6328 ) -> super::super::DeleteRecipientRequest {
6329 #[allow(unused_imports)]
6330 use ::buffa::alloc::string::ToString as _;
6331 let _ = __buffa_src;
6332 super::super::DeleteRecipientRequest {
6333 name: self.name.to_string(),
6334 __buffa_unknown_fields: self
6335 .__buffa_unknown_fields
6336 .to_owned()
6337 .unwrap_or_default()
6338 .into(),
6339 ..::core::default::Default::default()
6340 }
6341 }
6342 }
6343 impl<'a> ::buffa::ViewEncode<'a> for DeleteRecipientRequestView<'a> {
6344 #[allow(clippy::needless_borrow, clippy::let_and_return)]
6345 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
6346 #[allow(unused_imports)]
6347 use ::buffa::Enumeration as _;
6348 let mut size = 0u32;
6349 if !self.name.is_empty() {
6350 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
6351 }
6352 size += self.__buffa_unknown_fields.encoded_len() as u32;
6353 size
6354 }
6355 #[allow(clippy::needless_borrow)]
6356 fn write_to(
6357 &self,
6358 _cache: &mut ::buffa::SizeCache,
6359 buf: &mut impl ::buffa::bytes::BufMut,
6360 ) {
6361 #[allow(unused_imports)]
6362 use ::buffa::Enumeration as _;
6363 if !self.name.is_empty() {
6364 ::buffa::encoding::Tag::new(
6365 1u32,
6366 ::buffa::encoding::WireType::LengthDelimited,
6367 )
6368 .encode(buf);
6369 ::buffa::types::encode_string(&self.name, buf);
6370 }
6371 self.__buffa_unknown_fields.write_to(buf);
6372 }
6373 }
6374 impl<'__a> ::serde::Serialize for DeleteRecipientRequestView<'__a> {
6386 fn serialize<__S: ::serde::Serializer>(
6387 &self,
6388 __s: __S,
6389 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6390 use ::serde::ser::SerializeMap as _;
6391 let mut __map = __s.serialize_map(::core::option::Option::None)?;
6392 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
6393 __map.serialize_entry("name", self.name)?;
6394 }
6395 __map.end()
6396 }
6397 }
6398 impl<'a> ::buffa::MessageName for DeleteRecipientRequestView<'a> {
6399 const PACKAGE: &'static str = "unitycatalog.recipients.v1";
6400 const NAME: &'static str = "DeleteRecipientRequest";
6401 const FULL_NAME: &'static str = "unitycatalog.recipients.v1.DeleteRecipientRequest";
6402 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.recipients.v1.DeleteRecipientRequest";
6403 }
6404 impl<'v> ::buffa::DefaultViewInstance for DeleteRecipientRequestView<'v> {
6405 fn default_view_instance<'a>() -> &'a Self
6406 where
6407 Self: 'a,
6408 {
6409 static VALUE: ::buffa::__private::OnceBox<
6410 DeleteRecipientRequestView<'static>,
6411 > = ::buffa::__private::OnceBox::new();
6412 VALUE
6413 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
6414 <DeleteRecipientRequestView<'static>>::default(),
6415 ))
6416 }
6417 }
6418 impl ::buffa::ViewReborrow for DeleteRecipientRequestView<'static> {
6419 type Reborrowed<'b> = DeleteRecipientRequestView<'b>;
6420 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
6421 this
6422 }
6423 }
6424 #[derive(Clone, Debug)]
6430 pub struct DeleteRecipientRequestOwnedView(
6431 ::buffa::OwnedView<DeleteRecipientRequestView<'static>>,
6432 );
6433 impl DeleteRecipientRequestOwnedView {
6434 pub fn decode(
6444 bytes: ::buffa::bytes::Bytes,
6445 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6446 ::core::result::Result::Ok(
6447 DeleteRecipientRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
6448 )
6449 }
6450 pub fn decode_with_options(
6458 bytes: ::buffa::bytes::Bytes,
6459 opts: &::buffa::DecodeOptions,
6460 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6461 ::core::result::Result::Ok(
6462 DeleteRecipientRequestOwnedView(
6463 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
6464 ),
6465 )
6466 }
6467 pub fn from_owned(
6474 msg: &super::super::DeleteRecipientRequest,
6475 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6476 ::core::result::Result::Ok(
6477 DeleteRecipientRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
6478 )
6479 }
6480 #[must_use]
6482 pub fn view(&self) -> &DeleteRecipientRequestView<'_> {
6483 self.0.reborrow()
6484 }
6485 #[must_use]
6487 pub fn to_owned_message(&self) -> super::super::DeleteRecipientRequest {
6488 self.0.to_owned_message()
6489 }
6490 #[must_use]
6492 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
6493 self.0.bytes()
6494 }
6495 #[must_use]
6497 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
6498 self.0.into_bytes()
6499 }
6500 #[must_use]
6504 pub fn name(&self) -> &'_ str {
6505 self.0.reborrow().name
6506 }
6507 }
6508 impl ::core::convert::From<
6509 ::buffa::OwnedView<DeleteRecipientRequestView<'static>>,
6510 > for DeleteRecipientRequestOwnedView {
6511 fn from(
6512 inner: ::buffa::OwnedView<DeleteRecipientRequestView<'static>>,
6513 ) -> Self {
6514 DeleteRecipientRequestOwnedView(inner)
6515 }
6516 }
6517 impl ::core::convert::From<DeleteRecipientRequestOwnedView>
6518 for ::buffa::OwnedView<DeleteRecipientRequestView<'static>> {
6519 fn from(wrapper: DeleteRecipientRequestOwnedView) -> Self {
6520 wrapper.0
6521 }
6522 }
6523 impl ::core::convert::AsRef<
6524 ::buffa::OwnedView<DeleteRecipientRequestView<'static>>,
6525 > for DeleteRecipientRequestOwnedView {
6526 fn as_ref(
6527 &self,
6528 ) -> &::buffa::OwnedView<DeleteRecipientRequestView<'static>> {
6529 &self.0
6530 }
6531 }
6532 impl ::buffa::HasMessageView for super::super::DeleteRecipientRequest {
6533 type View<'a> = DeleteRecipientRequestView<'a>;
6534 type ViewHandle = DeleteRecipientRequestOwnedView;
6535 }
6536 impl ::serde::Serialize for DeleteRecipientRequestOwnedView {
6537 fn serialize<__S: ::serde::Serializer>(
6538 &self,
6539 __s: __S,
6540 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6541 ::serde::Serialize::serialize(&self.0, __s)
6542 }
6543 }
6544 }
6545 pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
6547 reg.register_json_any(super::__RECIPIENT_TOKEN_JSON_ANY);
6548 reg.register_json_any(super::__RECIPIENT_JSON_ANY);
6549 reg.register_json_any(super::__LIST_RECIPIENTS_REQUEST_JSON_ANY);
6550 reg.register_json_any(super::__LIST_RECIPIENTS_RESPONSE_JSON_ANY);
6551 reg.register_json_any(super::__CREATE_RECIPIENT_REQUEST_JSON_ANY);
6552 reg.register_json_any(super::__GET_RECIPIENT_REQUEST_JSON_ANY);
6553 reg.register_json_any(super::__UPDATE_RECIPIENT_REQUEST_JSON_ANY);
6554 reg.register_json_any(super::__DELETE_RECIPIENT_REQUEST_JSON_ANY);
6555 }
6556}
6557#[doc(inline)]
6558pub use self::__buffa::view::RecipientTokenView;
6559#[doc(inline)]
6560pub use self::__buffa::view::RecipientTokenOwnedView;
6561#[doc(inline)]
6562pub use self::__buffa::view::RecipientView;
6563#[doc(inline)]
6564pub use self::__buffa::view::RecipientOwnedView;
6565#[doc(inline)]
6566pub use self::__buffa::view::ListRecipientsRequestView;
6567#[doc(inline)]
6568pub use self::__buffa::view::ListRecipientsRequestOwnedView;
6569#[doc(inline)]
6570pub use self::__buffa::view::ListRecipientsResponseView;
6571#[doc(inline)]
6572pub use self::__buffa::view::ListRecipientsResponseOwnedView;
6573#[doc(inline)]
6574pub use self::__buffa::view::CreateRecipientRequestView;
6575#[doc(inline)]
6576pub use self::__buffa::view::CreateRecipientRequestOwnedView;
6577#[doc(inline)]
6578pub use self::__buffa::view::GetRecipientRequestView;
6579#[doc(inline)]
6580pub use self::__buffa::view::GetRecipientRequestOwnedView;
6581#[doc(inline)]
6582pub use self::__buffa::view::UpdateRecipientRequestView;
6583#[doc(inline)]
6584pub use self::__buffa::view::UpdateRecipientRequestOwnedView;
6585#[doc(inline)]
6586pub use self::__buffa::view::DeleteRecipientRequestView;
6587#[doc(inline)]
6588pub use self::__buffa::view::DeleteRecipientRequestOwnedView;
6589#[doc(inline)]
6590pub use self::__buffa::register_types;