1#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
5#[repr(i32)]
6pub enum ProviderAuthenticationType {
7 PROVIDER_AUTHENTICATION_TYPE_UNSPECIFIED = 0i32,
9 TOKEN = 1i32,
11 OAUTH_CLIENT_CREDENTIALS = 2i32,
13}
14impl ProviderAuthenticationType {
15 #[allow(non_upper_case_globals)]
17 pub const ProviderAuthenticationTypeUnspecified: Self = Self::PROVIDER_AUTHENTICATION_TYPE_UNSPECIFIED;
18 #[allow(non_upper_case_globals)]
20 pub const Token: Self = Self::TOKEN;
21 #[allow(non_upper_case_globals)]
23 pub const OauthClientCredentials: Self = Self::OAUTH_CLIENT_CREDENTIALS;
24}
25impl ::core::default::Default for ProviderAuthenticationType {
26 fn default() -> Self {
27 Self::PROVIDER_AUTHENTICATION_TYPE_UNSPECIFIED
28 }
29}
30impl ::serde::Serialize for ProviderAuthenticationType {
31 fn serialize<S: ::serde::Serializer>(
32 &self,
33 s: S,
34 ) -> ::core::result::Result<S::Ok, S::Error> {
35 s.serialize_str(::buffa::Enumeration::proto_name(self))
36 }
37}
38impl<'de> ::serde::Deserialize<'de> for ProviderAuthenticationType {
39 fn deserialize<D: ::serde::Deserializer<'de>>(
40 d: D,
41 ) -> ::core::result::Result<Self, D::Error> {
42 struct _V;
43 impl ::serde::de::Visitor<'_> for _V {
44 type Value = ProviderAuthenticationType;
45 fn expecting(
46 &self,
47 f: &mut ::core::fmt::Formatter<'_>,
48 ) -> ::core::fmt::Result {
49 f.write_str(
50 concat!(
51 "a string, integer, or null for ",
52 stringify!(ProviderAuthenticationType)
53 ),
54 )
55 }
56 fn visit_str<E: ::serde::de::Error>(
57 self,
58 v: &str,
59 ) -> ::core::result::Result<ProviderAuthenticationType, E> {
60 <ProviderAuthenticationType as ::buffa::Enumeration>::from_proto_name(v)
61 .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
62 }
63 fn visit_i64<E: ::serde::de::Error>(
64 self,
65 v: i64,
66 ) -> ::core::result::Result<ProviderAuthenticationType, E> {
67 let v32 = i32::try_from(v)
68 .map_err(|_| {
69 ::serde::de::Error::custom(
70 ::buffa::alloc::format!("enum value {v} out of i32 range"),
71 )
72 })?;
73 <ProviderAuthenticationType as ::buffa::Enumeration>::from_i32(v32)
74 .ok_or_else(|| {
75 ::serde::de::Error::custom(
76 ::buffa::alloc::format!("unknown enum value {v32}"),
77 )
78 })
79 }
80 fn visit_u64<E: ::serde::de::Error>(
81 self,
82 v: u64,
83 ) -> ::core::result::Result<ProviderAuthenticationType, E> {
84 let v32 = i32::try_from(v)
85 .map_err(|_| {
86 ::serde::de::Error::custom(
87 ::buffa::alloc::format!("enum value {v} out of i32 range"),
88 )
89 })?;
90 <ProviderAuthenticationType as ::buffa::Enumeration>::from_i32(v32)
91 .ok_or_else(|| {
92 ::serde::de::Error::custom(
93 ::buffa::alloc::format!("unknown enum value {v32}"),
94 )
95 })
96 }
97 fn visit_unit<E: ::serde::de::Error>(
98 self,
99 ) -> ::core::result::Result<ProviderAuthenticationType, E> {
100 ::core::result::Result::Ok(::core::default::Default::default())
101 }
102 }
103 d.deserialize_any(_V)
104 }
105}
106impl ::buffa::json_helpers::ProtoElemJson for ProviderAuthenticationType {
107 fn serialize_proto_json<S: ::serde::Serializer>(
108 v: &Self,
109 s: S,
110 ) -> ::core::result::Result<S::Ok, S::Error> {
111 ::serde::Serialize::serialize(v, s)
112 }
113 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
114 d: D,
115 ) -> ::core::result::Result<Self, D::Error> {
116 <Self as ::serde::Deserialize>::deserialize(d)
117 }
118}
119impl ::buffa::Enumeration for ProviderAuthenticationType {
120 fn from_i32(value: i32) -> ::core::option::Option<Self> {
121 match value {
122 0i32 => {
123 ::core::option::Option::Some(
124 Self::PROVIDER_AUTHENTICATION_TYPE_UNSPECIFIED,
125 )
126 }
127 1i32 => ::core::option::Option::Some(Self::TOKEN),
128 2i32 => ::core::option::Option::Some(Self::OAUTH_CLIENT_CREDENTIALS),
129 _ => ::core::option::Option::None,
130 }
131 }
132 fn to_i32(&self) -> i32 {
133 *self as i32
134 }
135 fn proto_name(&self) -> &'static str {
136 match self {
137 Self::PROVIDER_AUTHENTICATION_TYPE_UNSPECIFIED => {
138 "PROVIDER_AUTHENTICATION_TYPE_UNSPECIFIED"
139 }
140 Self::TOKEN => "TOKEN",
141 Self::OAUTH_CLIENT_CREDENTIALS => "OAUTH_CLIENT_CREDENTIALS",
142 }
143 }
144 fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
145 match name {
146 "PROVIDER_AUTHENTICATION_TYPE_UNSPECIFIED" => {
147 ::core::option::Option::Some(
148 Self::PROVIDER_AUTHENTICATION_TYPE_UNSPECIFIED,
149 )
150 }
151 "TOKEN" => ::core::option::Option::Some(Self::TOKEN),
152 "OAUTH_CLIENT_CREDENTIALS" => {
153 ::core::option::Option::Some(Self::OAUTH_CLIENT_CREDENTIALS)
154 }
155 _ => ::core::option::Option::None,
156 }
157 }
158 fn values() -> &'static [Self] {
159 &[
160 Self::PROVIDER_AUTHENTICATION_TYPE_UNSPECIFIED,
161 Self::TOKEN,
162 Self::OAUTH_CLIENT_CREDENTIALS,
163 ]
164 }
165}
166#[derive(Clone, PartialEq, Default)]
172#[derive(::serde::Serialize, ::serde::Deserialize)]
173#[serde(default)]
174pub struct Provider {
175 #[serde(rename = "id", skip_serializing_if = "::core::option::Option::is_none")]
179 pub id: ::core::option::Option<::buffa::alloc::string::String>,
180 #[serde(
184 rename = "name",
185 with = "::buffa::json_helpers::proto_string",
186 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
187 )]
188 pub name: ::buffa::alloc::string::String,
189 #[serde(
193 rename = "authentication_type",
194 alias = "authenticationType",
195 with = "::buffa::json_helpers::proto_enum",
196 skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
197 )]
198 pub authentication_type: ::buffa::EnumValue<ProviderAuthenticationType>,
199 #[serde(rename = "owner", skip_serializing_if = "::core::option::Option::is_none")]
203 pub owner: ::core::option::Option<::buffa::alloc::string::String>,
204 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
208 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
209 #[serde(
214 rename = "recipient_profile_str",
215 alias = "recipientProfileStr",
216 skip_serializing_if = "::core::option::Option::is_none"
217 )]
218 pub recipient_profile_str: ::core::option::Option<::buffa::alloc::string::String>,
219 #[serde(
223 rename = "properties",
224 skip_serializing_if = "::buffa::__private::HashMap::is_empty",
225 deserialize_with = "::buffa::json_helpers::null_as_default"
226 )]
227 pub properties: ::buffa::__private::HashMap<
228 ::buffa::alloc::string::String,
229 ::buffa::alloc::string::String,
230 >,
231 #[serde(
235 rename = "created_at",
236 alias = "createdAt",
237 with = "::buffa::json_helpers::opt_int64",
238 skip_serializing_if = "::core::option::Option::is_none"
239 )]
240 pub created_at: ::core::option::Option<i64>,
241 #[serde(
245 rename = "created_by",
246 alias = "createdBy",
247 skip_serializing_if = "::core::option::Option::is_none"
248 )]
249 pub created_by: ::core::option::Option<::buffa::alloc::string::String>,
250 #[serde(
254 rename = "updated_at",
255 alias = "updatedAt",
256 with = "::buffa::json_helpers::opt_int64",
257 skip_serializing_if = "::core::option::Option::is_none"
258 )]
259 pub updated_at: ::core::option::Option<i64>,
260 #[serde(
264 rename = "updated_by",
265 alias = "updatedBy",
266 skip_serializing_if = "::core::option::Option::is_none"
267 )]
268 pub updated_by: ::core::option::Option<::buffa::alloc::string::String>,
269 #[serde(skip)]
270 #[doc(hidden)]
271 pub __buffa_unknown_fields: ::buffa::UnknownFields,
272}
273impl ::core::fmt::Debug for Provider {
274 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
275 f.debug_struct("Provider")
276 .field("id", &self.id)
277 .field("name", &self.name)
278 .field("authentication_type", &self.authentication_type)
279 .field("owner", &self.owner)
280 .field("comment", &self.comment)
281 .field("recipient_profile_str", &self.recipient_profile_str)
282 .field("properties", &self.properties)
283 .field("created_at", &self.created_at)
284 .field("created_by", &self.created_by)
285 .field("updated_at", &self.updated_at)
286 .field("updated_by", &self.updated_by)
287 .finish()
288 }
289}
290impl Provider {
291 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.Provider";
296}
297impl Provider {
298 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
299 #[inline]
300 pub fn with_id(mut self, value: impl Into<::buffa::alloc::string::String>) -> Self {
302 self.id = Some(value.into());
303 self
304 }
305 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
306 #[inline]
307 pub fn with_owner(
309 mut self,
310 value: impl Into<::buffa::alloc::string::String>,
311 ) -> Self {
312 self.owner = Some(value.into());
313 self
314 }
315 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
316 #[inline]
317 pub fn with_comment(
319 mut self,
320 value: impl Into<::buffa::alloc::string::String>,
321 ) -> Self {
322 self.comment = Some(value.into());
323 self
324 }
325 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
326 #[inline]
327 pub fn with_recipient_profile_str(
329 mut self,
330 value: impl Into<::buffa::alloc::string::String>,
331 ) -> Self {
332 self.recipient_profile_str = Some(value.into());
333 self
334 }
335 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
336 #[inline]
337 pub fn with_created_at(mut self, value: i64) -> Self {
339 self.created_at = Some(value);
340 self
341 }
342 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
343 #[inline]
344 pub fn with_created_by(
346 mut self,
347 value: impl Into<::buffa::alloc::string::String>,
348 ) -> Self {
349 self.created_by = Some(value.into());
350 self
351 }
352 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
353 #[inline]
354 pub fn with_updated_at(mut self, value: i64) -> Self {
356 self.updated_at = Some(value);
357 self
358 }
359 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
360 #[inline]
361 pub fn with_updated_by(
363 mut self,
364 value: impl Into<::buffa::alloc::string::String>,
365 ) -> Self {
366 self.updated_by = Some(value.into());
367 self
368 }
369}
370impl ::buffa::DefaultInstance for Provider {
371 fn default_instance() -> &'static Self {
372 static VALUE: ::buffa::__private::OnceBox<Provider> = ::buffa::__private::OnceBox::new();
373 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
374 }
375}
376impl ::buffa::MessageName for Provider {
377 const PACKAGE: &'static str = "unitycatalog.providers.v1";
378 const NAME: &'static str = "Provider";
379 const FULL_NAME: &'static str = "unitycatalog.providers.v1.Provider";
380 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.Provider";
381}
382impl ::buffa::Message for Provider {
383 #[allow(clippy::let_and_return)]
389 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
390 #[allow(unused_imports)]
391 use ::buffa::Enumeration as _;
392 let mut size = 0u32;
393 if !self.name.is_empty() {
394 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
395 }
396 {
397 let val = self.authentication_type.to_i32();
398 if val != 0 {
399 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
400 }
401 }
402 if let Some(ref v) = self.owner {
403 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
404 }
405 if let Some(ref v) = self.comment {
406 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
407 }
408 if let Some(ref v) = self.recipient_profile_str {
409 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
410 }
411 #[allow(clippy::for_kv_map)]
412 for (k, v) in &self.properties {
413 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
414 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
415 size
416 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
417 + entry_size;
418 }
419 if let Some(v) = self.created_at {
420 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
421 }
422 if let Some(ref v) = self.created_by {
423 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
424 }
425 if let Some(v) = self.updated_at {
426 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
427 }
428 if let Some(ref v) = self.updated_by {
429 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
430 }
431 if let Some(ref v) = self.id {
432 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
433 }
434 size += self.__buffa_unknown_fields.encoded_len() as u32;
435 size
436 }
437 fn write_to(
438 &self,
439 _cache: &mut ::buffa::SizeCache,
440 buf: &mut impl ::buffa::bytes::BufMut,
441 ) {
442 #[allow(unused_imports)]
443 use ::buffa::Enumeration as _;
444 if !self.name.is_empty() {
445 ::buffa::encoding::Tag::new(
446 1u32,
447 ::buffa::encoding::WireType::LengthDelimited,
448 )
449 .encode(buf);
450 ::buffa::types::encode_string(&self.name, buf);
451 }
452 {
453 let val = self.authentication_type.to_i32();
454 if val != 0 {
455 ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
456 .encode(buf);
457 ::buffa::types::encode_int32(val, buf);
458 }
459 }
460 if let Some(ref v) = self.owner {
461 ::buffa::encoding::Tag::new(
462 3u32,
463 ::buffa::encoding::WireType::LengthDelimited,
464 )
465 .encode(buf);
466 ::buffa::types::encode_string(v, buf);
467 }
468 if let Some(ref v) = self.comment {
469 ::buffa::encoding::Tag::new(
470 4u32,
471 ::buffa::encoding::WireType::LengthDelimited,
472 )
473 .encode(buf);
474 ::buffa::types::encode_string(v, buf);
475 }
476 if let Some(ref v) = self.recipient_profile_str {
477 ::buffa::encoding::Tag::new(
478 5u32,
479 ::buffa::encoding::WireType::LengthDelimited,
480 )
481 .encode(buf);
482 ::buffa::types::encode_string(v, buf);
483 }
484 for (k, v) in &self.properties {
485 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
486 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
487 ::buffa::encoding::Tag::new(
488 6u32,
489 ::buffa::encoding::WireType::LengthDelimited,
490 )
491 .encode(buf);
492 ::buffa::encoding::encode_varint(entry_size as u64, buf);
493 ::buffa::encoding::Tag::new(
494 1u32,
495 ::buffa::encoding::WireType::LengthDelimited,
496 )
497 .encode(buf);
498 ::buffa::types::encode_string(k, buf);
499 ::buffa::encoding::Tag::new(
500 2u32,
501 ::buffa::encoding::WireType::LengthDelimited,
502 )
503 .encode(buf);
504 ::buffa::types::encode_string(v, buf);
505 }
506 if let Some(v) = self.created_at {
507 ::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
508 .encode(buf);
509 ::buffa::types::encode_int64(v, buf);
510 }
511 if let Some(ref v) = self.created_by {
512 ::buffa::encoding::Tag::new(
513 8u32,
514 ::buffa::encoding::WireType::LengthDelimited,
515 )
516 .encode(buf);
517 ::buffa::types::encode_string(v, buf);
518 }
519 if let Some(v) = self.updated_at {
520 ::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
521 .encode(buf);
522 ::buffa::types::encode_int64(v, buf);
523 }
524 if let Some(ref v) = self.updated_by {
525 ::buffa::encoding::Tag::new(
526 10u32,
527 ::buffa::encoding::WireType::LengthDelimited,
528 )
529 .encode(buf);
530 ::buffa::types::encode_string(v, buf);
531 }
532 if let Some(ref v) = self.id {
533 ::buffa::encoding::Tag::new(
534 100u32,
535 ::buffa::encoding::WireType::LengthDelimited,
536 )
537 .encode(buf);
538 ::buffa::types::encode_string(v, buf);
539 }
540 self.__buffa_unknown_fields.write_to(buf);
541 }
542 fn merge_field(
543 &mut self,
544 tag: ::buffa::encoding::Tag,
545 buf: &mut impl ::buffa::bytes::Buf,
546 depth: u32,
547 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
548 #[allow(unused_imports)]
549 use ::buffa::bytes::Buf as _;
550 #[allow(unused_imports)]
551 use ::buffa::Enumeration as _;
552 match tag.field_number() {
553 1u32 => {
554 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
555 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
556 field_number: 1u32,
557 expected: 2u8,
558 actual: tag.wire_type() as u8,
559 });
560 }
561 ::buffa::types::merge_string(&mut self.name, buf)?;
562 }
563 2u32 => {
564 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
565 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
566 field_number: 2u32,
567 expected: 0u8,
568 actual: tag.wire_type() as u8,
569 });
570 }
571 self.authentication_type = ::buffa::EnumValue::from(
572 ::buffa::types::decode_int32(buf)?,
573 );
574 }
575 3u32 => {
576 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
577 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
578 field_number: 3u32,
579 expected: 2u8,
580 actual: tag.wire_type() as u8,
581 });
582 }
583 ::buffa::types::merge_string(
584 self.owner.get_or_insert_with(::buffa::alloc::string::String::new),
585 buf,
586 )?;
587 }
588 4u32 => {
589 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
590 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
591 field_number: 4u32,
592 expected: 2u8,
593 actual: tag.wire_type() as u8,
594 });
595 }
596 ::buffa::types::merge_string(
597 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
598 buf,
599 )?;
600 }
601 5u32 => {
602 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
603 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
604 field_number: 5u32,
605 expected: 2u8,
606 actual: tag.wire_type() as u8,
607 });
608 }
609 ::buffa::types::merge_string(
610 self
611 .recipient_profile_str
612 .get_or_insert_with(::buffa::alloc::string::String::new),
613 buf,
614 )?;
615 }
616 6u32 => {
617 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
618 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
619 field_number: 6u32,
620 expected: 2u8,
621 actual: tag.wire_type() as u8,
622 });
623 }
624 let entry_len = ::buffa::encoding::decode_varint(buf)?;
625 let entry_len = usize::try_from(entry_len)
626 .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
627 if buf.remaining() < entry_len {
628 return ::core::result::Result::Err(
629 ::buffa::DecodeError::UnexpectedEof,
630 );
631 }
632 let entry_limit = buf.remaining() - entry_len;
633 let mut key = ::core::default::Default::default();
634 let mut val = ::core::default::Default::default();
635 while buf.remaining() > entry_limit {
636 let entry_tag = ::buffa::encoding::Tag::decode(buf)?;
637 match entry_tag.field_number() {
638 1 => {
639 if entry_tag.wire_type()
640 != ::buffa::encoding::WireType::LengthDelimited
641 {
642 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
643 field_number: entry_tag.field_number(),
644 expected: 2u8,
645 actual: entry_tag.wire_type() as u8,
646 });
647 }
648 key = ::buffa::types::decode_string(buf)?;
649 }
650 2 => {
651 if entry_tag.wire_type()
652 != ::buffa::encoding::WireType::LengthDelimited
653 {
654 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
655 field_number: entry_tag.field_number(),
656 expected: 2u8,
657 actual: entry_tag.wire_type() as u8,
658 });
659 }
660 val = ::buffa::types::decode_string(buf)?;
661 }
662 _ => {
663 ::buffa::encoding::skip_field_depth(entry_tag, buf, depth)?;
664 }
665 }
666 }
667 if buf.remaining() != entry_limit {
668 let remaining = buf.remaining();
669 if remaining > entry_limit {
670 buf.advance(remaining - entry_limit);
671 } else {
672 return ::core::result::Result::Err(
673 ::buffa::DecodeError::UnexpectedEof,
674 );
675 }
676 }
677 self.properties.insert(key, val);
678 }
679 7u32 => {
680 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
681 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
682 field_number: 7u32,
683 expected: 0u8,
684 actual: tag.wire_type() as u8,
685 });
686 }
687 self.created_at = ::core::option::Option::Some(
688 ::buffa::types::decode_int64(buf)?,
689 );
690 }
691 8u32 => {
692 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
693 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
694 field_number: 8u32,
695 expected: 2u8,
696 actual: tag.wire_type() as u8,
697 });
698 }
699 ::buffa::types::merge_string(
700 self
701 .created_by
702 .get_or_insert_with(::buffa::alloc::string::String::new),
703 buf,
704 )?;
705 }
706 9u32 => {
707 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
708 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
709 field_number: 9u32,
710 expected: 0u8,
711 actual: tag.wire_type() as u8,
712 });
713 }
714 self.updated_at = ::core::option::Option::Some(
715 ::buffa::types::decode_int64(buf)?,
716 );
717 }
718 10u32 => {
719 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
720 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
721 field_number: 10u32,
722 expected: 2u8,
723 actual: tag.wire_type() as u8,
724 });
725 }
726 ::buffa::types::merge_string(
727 self
728 .updated_by
729 .get_or_insert_with(::buffa::alloc::string::String::new),
730 buf,
731 )?;
732 }
733 100u32 => {
734 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
735 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
736 field_number: 100u32,
737 expected: 2u8,
738 actual: tag.wire_type() as u8,
739 });
740 }
741 ::buffa::types::merge_string(
742 self.id.get_or_insert_with(::buffa::alloc::string::String::new),
743 buf,
744 )?;
745 }
746 _ => {
747 self.__buffa_unknown_fields
748 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
749 }
750 }
751 ::core::result::Result::Ok(())
752 }
753 fn clear(&mut self) {
754 self.name.clear();
755 self.authentication_type = ::buffa::EnumValue::from(0);
756 self.owner = ::core::option::Option::None;
757 self.comment = ::core::option::Option::None;
758 self.recipient_profile_str = ::core::option::Option::None;
759 self.properties.clear();
760 self.created_at = ::core::option::Option::None;
761 self.created_by = ::core::option::Option::None;
762 self.updated_at = ::core::option::Option::None;
763 self.updated_by = ::core::option::Option::None;
764 self.id = ::core::option::Option::None;
765 self.__buffa_unknown_fields.clear();
766 }
767}
768impl ::buffa::ExtensionSet for Provider {
769 const PROTO_FQN: &'static str = "unitycatalog.providers.v1.Provider";
770 fn unknown_fields(&self) -> &::buffa::UnknownFields {
771 &self.__buffa_unknown_fields
772 }
773 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
774 &mut self.__buffa_unknown_fields
775 }
776}
777impl ::buffa::json_helpers::ProtoElemJson for Provider {
778 fn serialize_proto_json<S: ::serde::Serializer>(
779 v: &Self,
780 s: S,
781 ) -> ::core::result::Result<S::Ok, S::Error> {
782 ::serde::Serialize::serialize(v, s)
783 }
784 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
785 d: D,
786 ) -> ::core::result::Result<Self, D::Error> {
787 <Self as ::serde::Deserialize>::deserialize(d)
788 }
789}
790#[doc(hidden)]
791pub const __PROVIDER_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
792 type_url: "type.googleapis.com/unitycatalog.providers.v1.Provider",
793 to_json: ::buffa::type_registry::any_to_json::<Provider>,
794 from_json: ::buffa::type_registry::any_from_json::<Provider>,
795 is_wkt: false,
796};
797#[derive(Clone, PartialEq, Default)]
799#[derive(::serde::Serialize, ::serde::Deserialize)]
800#[serde(default)]
801pub struct ListProvidersRequest {
802 #[serde(
806 rename = "max_results",
807 alias = "maxResults",
808 with = "::buffa::json_helpers::opt_int32",
809 skip_serializing_if = "::core::option::Option::is_none"
810 )]
811 pub max_results: ::core::option::Option<i32>,
812 #[serde(
816 rename = "page_token",
817 alias = "pageToken",
818 skip_serializing_if = "::core::option::Option::is_none"
819 )]
820 pub page_token: ::core::option::Option<::buffa::alloc::string::String>,
821 #[serde(skip)]
822 #[doc(hidden)]
823 pub __buffa_unknown_fields: ::buffa::UnknownFields,
824}
825impl ::core::fmt::Debug for ListProvidersRequest {
826 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
827 f.debug_struct("ListProvidersRequest")
828 .field("max_results", &self.max_results)
829 .field("page_token", &self.page_token)
830 .finish()
831 }
832}
833impl ListProvidersRequest {
834 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.ListProvidersRequest";
839}
840impl ListProvidersRequest {
841 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
842 #[inline]
843 pub fn with_max_results(mut self, value: i32) -> Self {
845 self.max_results = Some(value);
846 self
847 }
848 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
849 #[inline]
850 pub fn with_page_token(
852 mut self,
853 value: impl Into<::buffa::alloc::string::String>,
854 ) -> Self {
855 self.page_token = Some(value.into());
856 self
857 }
858}
859impl ::buffa::DefaultInstance for ListProvidersRequest {
860 fn default_instance() -> &'static Self {
861 static VALUE: ::buffa::__private::OnceBox<ListProvidersRequest> = ::buffa::__private::OnceBox::new();
862 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
863 }
864}
865impl ::buffa::MessageName for ListProvidersRequest {
866 const PACKAGE: &'static str = "unitycatalog.providers.v1";
867 const NAME: &'static str = "ListProvidersRequest";
868 const FULL_NAME: &'static str = "unitycatalog.providers.v1.ListProvidersRequest";
869 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.ListProvidersRequest";
870}
871impl ::buffa::Message for ListProvidersRequest {
872 #[allow(clippy::let_and_return)]
878 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
879 #[allow(unused_imports)]
880 use ::buffa::Enumeration as _;
881 let mut size = 0u32;
882 if let Some(v) = self.max_results {
883 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
884 }
885 if let Some(ref v) = self.page_token {
886 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
887 }
888 size += self.__buffa_unknown_fields.encoded_len() as u32;
889 size
890 }
891 fn write_to(
892 &self,
893 _cache: &mut ::buffa::SizeCache,
894 buf: &mut impl ::buffa::bytes::BufMut,
895 ) {
896 #[allow(unused_imports)]
897 use ::buffa::Enumeration as _;
898 if let Some(v) = self.max_results {
899 ::buffa::encoding::Tag::new(1u32, ::buffa::encoding::WireType::Varint)
900 .encode(buf);
901 ::buffa::types::encode_int32(v, buf);
902 }
903 if let Some(ref v) = self.page_token {
904 ::buffa::encoding::Tag::new(
905 2u32,
906 ::buffa::encoding::WireType::LengthDelimited,
907 )
908 .encode(buf);
909 ::buffa::types::encode_string(v, buf);
910 }
911 self.__buffa_unknown_fields.write_to(buf);
912 }
913 fn merge_field(
914 &mut self,
915 tag: ::buffa::encoding::Tag,
916 buf: &mut impl ::buffa::bytes::Buf,
917 depth: u32,
918 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
919 #[allow(unused_imports)]
920 use ::buffa::bytes::Buf as _;
921 #[allow(unused_imports)]
922 use ::buffa::Enumeration as _;
923 match tag.field_number() {
924 1u32 => {
925 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
926 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
927 field_number: 1u32,
928 expected: 0u8,
929 actual: tag.wire_type() as u8,
930 });
931 }
932 self.max_results = ::core::option::Option::Some(
933 ::buffa::types::decode_int32(buf)?,
934 );
935 }
936 2u32 => {
937 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
938 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
939 field_number: 2u32,
940 expected: 2u8,
941 actual: tag.wire_type() as u8,
942 });
943 }
944 ::buffa::types::merge_string(
945 self
946 .page_token
947 .get_or_insert_with(::buffa::alloc::string::String::new),
948 buf,
949 )?;
950 }
951 _ => {
952 self.__buffa_unknown_fields
953 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
954 }
955 }
956 ::core::result::Result::Ok(())
957 }
958 fn clear(&mut self) {
959 self.max_results = ::core::option::Option::None;
960 self.page_token = ::core::option::Option::None;
961 self.__buffa_unknown_fields.clear();
962 }
963}
964impl ::buffa::ExtensionSet for ListProvidersRequest {
965 const PROTO_FQN: &'static str = "unitycatalog.providers.v1.ListProvidersRequest";
966 fn unknown_fields(&self) -> &::buffa::UnknownFields {
967 &self.__buffa_unknown_fields
968 }
969 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
970 &mut self.__buffa_unknown_fields
971 }
972}
973impl ::buffa::json_helpers::ProtoElemJson for ListProvidersRequest {
974 fn serialize_proto_json<S: ::serde::Serializer>(
975 v: &Self,
976 s: S,
977 ) -> ::core::result::Result<S::Ok, S::Error> {
978 ::serde::Serialize::serialize(v, s)
979 }
980 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
981 d: D,
982 ) -> ::core::result::Result<Self, D::Error> {
983 <Self as ::serde::Deserialize>::deserialize(d)
984 }
985}
986#[doc(hidden)]
987pub const __LIST_PROVIDERS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
988 type_url: "type.googleapis.com/unitycatalog.providers.v1.ListProvidersRequest",
989 to_json: ::buffa::type_registry::any_to_json::<ListProvidersRequest>,
990 from_json: ::buffa::type_registry::any_from_json::<ListProvidersRequest>,
991 is_wkt: false,
992};
993#[derive(Clone, PartialEq, Default)]
995#[derive(::serde::Serialize, ::serde::Deserialize)]
996#[serde(default)]
997pub struct ListProvidersResponse {
998 #[serde(
1002 rename = "providers",
1003 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1004 deserialize_with = "::buffa::json_helpers::null_as_default"
1005 )]
1006 pub providers: ::buffa::alloc::vec::Vec<Provider>,
1007 #[serde(
1011 rename = "next_page_token",
1012 alias = "nextPageToken",
1013 skip_serializing_if = "::core::option::Option::is_none"
1014 )]
1015 pub next_page_token: ::core::option::Option<::buffa::alloc::string::String>,
1016 #[serde(skip)]
1017 #[doc(hidden)]
1018 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1019}
1020impl ::core::fmt::Debug for ListProvidersResponse {
1021 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1022 f.debug_struct("ListProvidersResponse")
1023 .field("providers", &self.providers)
1024 .field("next_page_token", &self.next_page_token)
1025 .finish()
1026 }
1027}
1028impl ListProvidersResponse {
1029 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.ListProvidersResponse";
1034}
1035impl ListProvidersResponse {
1036 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1037 #[inline]
1038 pub fn with_next_page_token(
1040 mut self,
1041 value: impl Into<::buffa::alloc::string::String>,
1042 ) -> Self {
1043 self.next_page_token = Some(value.into());
1044 self
1045 }
1046}
1047impl ::buffa::DefaultInstance for ListProvidersResponse {
1048 fn default_instance() -> &'static Self {
1049 static VALUE: ::buffa::__private::OnceBox<ListProvidersResponse> = ::buffa::__private::OnceBox::new();
1050 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1051 }
1052}
1053impl ::buffa::MessageName for ListProvidersResponse {
1054 const PACKAGE: &'static str = "unitycatalog.providers.v1";
1055 const NAME: &'static str = "ListProvidersResponse";
1056 const FULL_NAME: &'static str = "unitycatalog.providers.v1.ListProvidersResponse";
1057 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.ListProvidersResponse";
1058}
1059impl ::buffa::Message for ListProvidersResponse {
1060 #[allow(clippy::let_and_return)]
1066 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1067 #[allow(unused_imports)]
1068 use ::buffa::Enumeration as _;
1069 let mut size = 0u32;
1070 for v in &self.providers {
1071 let __slot = __cache.reserve();
1072 let inner_size = v.compute_size(__cache);
1073 __cache.set(__slot, inner_size);
1074 size
1075 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1076 + inner_size;
1077 }
1078 if let Some(ref v) = self.next_page_token {
1079 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1080 }
1081 size += self.__buffa_unknown_fields.encoded_len() as u32;
1082 size
1083 }
1084 fn write_to(
1085 &self,
1086 __cache: &mut ::buffa::SizeCache,
1087 buf: &mut impl ::buffa::bytes::BufMut,
1088 ) {
1089 #[allow(unused_imports)]
1090 use ::buffa::Enumeration as _;
1091 for v in &self.providers {
1092 ::buffa::encoding::Tag::new(
1093 1u32,
1094 ::buffa::encoding::WireType::LengthDelimited,
1095 )
1096 .encode(buf);
1097 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1098 v.write_to(__cache, buf);
1099 }
1100 if let Some(ref v) = self.next_page_token {
1101 ::buffa::encoding::Tag::new(
1102 2u32,
1103 ::buffa::encoding::WireType::LengthDelimited,
1104 )
1105 .encode(buf);
1106 ::buffa::types::encode_string(v, buf);
1107 }
1108 self.__buffa_unknown_fields.write_to(buf);
1109 }
1110 fn merge_field(
1111 &mut self,
1112 tag: ::buffa::encoding::Tag,
1113 buf: &mut impl ::buffa::bytes::Buf,
1114 depth: u32,
1115 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1116 #[allow(unused_imports)]
1117 use ::buffa::bytes::Buf as _;
1118 #[allow(unused_imports)]
1119 use ::buffa::Enumeration as _;
1120 match tag.field_number() {
1121 1u32 => {
1122 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1123 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1124 field_number: 1u32,
1125 expected: 2u8,
1126 actual: tag.wire_type() as u8,
1127 });
1128 }
1129 let mut elem = ::core::default::Default::default();
1130 ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
1131 self.providers.push(elem);
1132 }
1133 2u32 => {
1134 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1135 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1136 field_number: 2u32,
1137 expected: 2u8,
1138 actual: tag.wire_type() as u8,
1139 });
1140 }
1141 ::buffa::types::merge_string(
1142 self
1143 .next_page_token
1144 .get_or_insert_with(::buffa::alloc::string::String::new),
1145 buf,
1146 )?;
1147 }
1148 _ => {
1149 self.__buffa_unknown_fields
1150 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1151 }
1152 }
1153 ::core::result::Result::Ok(())
1154 }
1155 fn clear(&mut self) {
1156 self.providers.clear();
1157 self.next_page_token = ::core::option::Option::None;
1158 self.__buffa_unknown_fields.clear();
1159 }
1160}
1161impl ::buffa::ExtensionSet for ListProvidersResponse {
1162 const PROTO_FQN: &'static str = "unitycatalog.providers.v1.ListProvidersResponse";
1163 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1164 &self.__buffa_unknown_fields
1165 }
1166 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1167 &mut self.__buffa_unknown_fields
1168 }
1169}
1170impl ::buffa::json_helpers::ProtoElemJson for ListProvidersResponse {
1171 fn serialize_proto_json<S: ::serde::Serializer>(
1172 v: &Self,
1173 s: S,
1174 ) -> ::core::result::Result<S::Ok, S::Error> {
1175 ::serde::Serialize::serialize(v, s)
1176 }
1177 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1178 d: D,
1179 ) -> ::core::result::Result<Self, D::Error> {
1180 <Self as ::serde::Deserialize>::deserialize(d)
1181 }
1182}
1183#[doc(hidden)]
1184pub const __LIST_PROVIDERS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1185 type_url: "type.googleapis.com/unitycatalog.providers.v1.ListProvidersResponse",
1186 to_json: ::buffa::type_registry::any_to_json::<ListProvidersResponse>,
1187 from_json: ::buffa::type_registry::any_from_json::<ListProvidersResponse>,
1188 is_wkt: false,
1189};
1190#[derive(Clone, PartialEq, Default)]
1192#[derive(::serde::Serialize, ::serde::Deserialize)]
1193#[serde(default)]
1194pub struct CreateProviderRequest {
1195 #[serde(
1199 rename = "name",
1200 with = "::buffa::json_helpers::proto_string",
1201 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1202 )]
1203 pub name: ::buffa::alloc::string::String,
1204 #[serde(
1208 rename = "authentication_type",
1209 alias = "authenticationType",
1210 with = "::buffa::json_helpers::proto_enum",
1211 skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
1212 )]
1213 pub authentication_type: ::buffa::EnumValue<ProviderAuthenticationType>,
1214 #[serde(rename = "owner", skip_serializing_if = "::core::option::Option::is_none")]
1218 pub owner: ::core::option::Option<::buffa::alloc::string::String>,
1219 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
1223 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
1224 #[serde(
1229 rename = "recipient_profile_str",
1230 alias = "recipientProfileStr",
1231 skip_serializing_if = "::core::option::Option::is_none"
1232 )]
1233 pub recipient_profile_str: ::core::option::Option<::buffa::alloc::string::String>,
1234 #[serde(
1238 rename = "properties",
1239 skip_serializing_if = "::buffa::__private::HashMap::is_empty",
1240 deserialize_with = "::buffa::json_helpers::null_as_default"
1241 )]
1242 pub properties: ::buffa::__private::HashMap<
1243 ::buffa::alloc::string::String,
1244 ::buffa::alloc::string::String,
1245 >,
1246 #[serde(skip)]
1247 #[doc(hidden)]
1248 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1249}
1250impl ::core::fmt::Debug for CreateProviderRequest {
1251 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1252 f.debug_struct("CreateProviderRequest")
1253 .field("name", &self.name)
1254 .field("authentication_type", &self.authentication_type)
1255 .field("owner", &self.owner)
1256 .field("comment", &self.comment)
1257 .field("recipient_profile_str", &self.recipient_profile_str)
1258 .field("properties", &self.properties)
1259 .finish()
1260 }
1261}
1262impl CreateProviderRequest {
1263 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.CreateProviderRequest";
1268}
1269impl CreateProviderRequest {
1270 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1271 #[inline]
1272 pub fn with_owner(
1274 mut self,
1275 value: impl Into<::buffa::alloc::string::String>,
1276 ) -> Self {
1277 self.owner = Some(value.into());
1278 self
1279 }
1280 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1281 #[inline]
1282 pub fn with_comment(
1284 mut self,
1285 value: impl Into<::buffa::alloc::string::String>,
1286 ) -> Self {
1287 self.comment = Some(value.into());
1288 self
1289 }
1290 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1291 #[inline]
1292 pub fn with_recipient_profile_str(
1294 mut self,
1295 value: impl Into<::buffa::alloc::string::String>,
1296 ) -> Self {
1297 self.recipient_profile_str = Some(value.into());
1298 self
1299 }
1300}
1301impl ::buffa::DefaultInstance for CreateProviderRequest {
1302 fn default_instance() -> &'static Self {
1303 static VALUE: ::buffa::__private::OnceBox<CreateProviderRequest> = ::buffa::__private::OnceBox::new();
1304 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1305 }
1306}
1307impl ::buffa::MessageName for CreateProviderRequest {
1308 const PACKAGE: &'static str = "unitycatalog.providers.v1";
1309 const NAME: &'static str = "CreateProviderRequest";
1310 const FULL_NAME: &'static str = "unitycatalog.providers.v1.CreateProviderRequest";
1311 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.CreateProviderRequest";
1312}
1313impl ::buffa::Message for CreateProviderRequest {
1314 #[allow(clippy::let_and_return)]
1320 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1321 #[allow(unused_imports)]
1322 use ::buffa::Enumeration as _;
1323 let mut size = 0u32;
1324 if !self.name.is_empty() {
1325 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
1326 }
1327 {
1328 let val = self.authentication_type.to_i32();
1329 if val != 0 {
1330 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
1331 }
1332 }
1333 if let Some(ref v) = self.owner {
1334 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1335 }
1336 if let Some(ref v) = self.comment {
1337 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1338 }
1339 if let Some(ref v) = self.recipient_profile_str {
1340 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1341 }
1342 #[allow(clippy::for_kv_map)]
1343 for (k, v) in &self.properties {
1344 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
1345 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1346 size
1347 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
1348 + entry_size;
1349 }
1350 size += self.__buffa_unknown_fields.encoded_len() as u32;
1351 size
1352 }
1353 fn write_to(
1354 &self,
1355 _cache: &mut ::buffa::SizeCache,
1356 buf: &mut impl ::buffa::bytes::BufMut,
1357 ) {
1358 #[allow(unused_imports)]
1359 use ::buffa::Enumeration as _;
1360 if !self.name.is_empty() {
1361 ::buffa::encoding::Tag::new(
1362 1u32,
1363 ::buffa::encoding::WireType::LengthDelimited,
1364 )
1365 .encode(buf);
1366 ::buffa::types::encode_string(&self.name, buf);
1367 }
1368 {
1369 let val = self.authentication_type.to_i32();
1370 if val != 0 {
1371 ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
1372 .encode(buf);
1373 ::buffa::types::encode_int32(val, buf);
1374 }
1375 }
1376 if let Some(ref v) = self.owner {
1377 ::buffa::encoding::Tag::new(
1378 3u32,
1379 ::buffa::encoding::WireType::LengthDelimited,
1380 )
1381 .encode(buf);
1382 ::buffa::types::encode_string(v, buf);
1383 }
1384 if let Some(ref v) = self.comment {
1385 ::buffa::encoding::Tag::new(
1386 4u32,
1387 ::buffa::encoding::WireType::LengthDelimited,
1388 )
1389 .encode(buf);
1390 ::buffa::types::encode_string(v, buf);
1391 }
1392 if let Some(ref v) = self.recipient_profile_str {
1393 ::buffa::encoding::Tag::new(
1394 5u32,
1395 ::buffa::encoding::WireType::LengthDelimited,
1396 )
1397 .encode(buf);
1398 ::buffa::types::encode_string(v, buf);
1399 }
1400 for (k, v) in &self.properties {
1401 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
1402 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1403 ::buffa::encoding::Tag::new(
1404 6u32,
1405 ::buffa::encoding::WireType::LengthDelimited,
1406 )
1407 .encode(buf);
1408 ::buffa::encoding::encode_varint(entry_size as u64, buf);
1409 ::buffa::encoding::Tag::new(
1410 1u32,
1411 ::buffa::encoding::WireType::LengthDelimited,
1412 )
1413 .encode(buf);
1414 ::buffa::types::encode_string(k, buf);
1415 ::buffa::encoding::Tag::new(
1416 2u32,
1417 ::buffa::encoding::WireType::LengthDelimited,
1418 )
1419 .encode(buf);
1420 ::buffa::types::encode_string(v, buf);
1421 }
1422 self.__buffa_unknown_fields.write_to(buf);
1423 }
1424 fn merge_field(
1425 &mut self,
1426 tag: ::buffa::encoding::Tag,
1427 buf: &mut impl ::buffa::bytes::Buf,
1428 depth: u32,
1429 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1430 #[allow(unused_imports)]
1431 use ::buffa::bytes::Buf as _;
1432 #[allow(unused_imports)]
1433 use ::buffa::Enumeration as _;
1434 match tag.field_number() {
1435 1u32 => {
1436 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1437 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1438 field_number: 1u32,
1439 expected: 2u8,
1440 actual: tag.wire_type() as u8,
1441 });
1442 }
1443 ::buffa::types::merge_string(&mut self.name, buf)?;
1444 }
1445 2u32 => {
1446 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1447 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1448 field_number: 2u32,
1449 expected: 0u8,
1450 actual: tag.wire_type() as u8,
1451 });
1452 }
1453 self.authentication_type = ::buffa::EnumValue::from(
1454 ::buffa::types::decode_int32(buf)?,
1455 );
1456 }
1457 3u32 => {
1458 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1459 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1460 field_number: 3u32,
1461 expected: 2u8,
1462 actual: tag.wire_type() as u8,
1463 });
1464 }
1465 ::buffa::types::merge_string(
1466 self.owner.get_or_insert_with(::buffa::alloc::string::String::new),
1467 buf,
1468 )?;
1469 }
1470 4u32 => {
1471 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1472 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1473 field_number: 4u32,
1474 expected: 2u8,
1475 actual: tag.wire_type() as u8,
1476 });
1477 }
1478 ::buffa::types::merge_string(
1479 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
1480 buf,
1481 )?;
1482 }
1483 5u32 => {
1484 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1485 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1486 field_number: 5u32,
1487 expected: 2u8,
1488 actual: tag.wire_type() as u8,
1489 });
1490 }
1491 ::buffa::types::merge_string(
1492 self
1493 .recipient_profile_str
1494 .get_or_insert_with(::buffa::alloc::string::String::new),
1495 buf,
1496 )?;
1497 }
1498 6u32 => {
1499 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1500 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1501 field_number: 6u32,
1502 expected: 2u8,
1503 actual: tag.wire_type() as u8,
1504 });
1505 }
1506 let entry_len = ::buffa::encoding::decode_varint(buf)?;
1507 let entry_len = usize::try_from(entry_len)
1508 .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
1509 if buf.remaining() < entry_len {
1510 return ::core::result::Result::Err(
1511 ::buffa::DecodeError::UnexpectedEof,
1512 );
1513 }
1514 let entry_limit = buf.remaining() - entry_len;
1515 let mut key = ::core::default::Default::default();
1516 let mut val = ::core::default::Default::default();
1517 while buf.remaining() > entry_limit {
1518 let entry_tag = ::buffa::encoding::Tag::decode(buf)?;
1519 match entry_tag.field_number() {
1520 1 => {
1521 if entry_tag.wire_type()
1522 != ::buffa::encoding::WireType::LengthDelimited
1523 {
1524 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1525 field_number: entry_tag.field_number(),
1526 expected: 2u8,
1527 actual: entry_tag.wire_type() as u8,
1528 });
1529 }
1530 key = ::buffa::types::decode_string(buf)?;
1531 }
1532 2 => {
1533 if entry_tag.wire_type()
1534 != ::buffa::encoding::WireType::LengthDelimited
1535 {
1536 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1537 field_number: entry_tag.field_number(),
1538 expected: 2u8,
1539 actual: entry_tag.wire_type() as u8,
1540 });
1541 }
1542 val = ::buffa::types::decode_string(buf)?;
1543 }
1544 _ => {
1545 ::buffa::encoding::skip_field_depth(entry_tag, buf, depth)?;
1546 }
1547 }
1548 }
1549 if buf.remaining() != entry_limit {
1550 let remaining = buf.remaining();
1551 if remaining > entry_limit {
1552 buf.advance(remaining - entry_limit);
1553 } else {
1554 return ::core::result::Result::Err(
1555 ::buffa::DecodeError::UnexpectedEof,
1556 );
1557 }
1558 }
1559 self.properties.insert(key, val);
1560 }
1561 _ => {
1562 self.__buffa_unknown_fields
1563 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1564 }
1565 }
1566 ::core::result::Result::Ok(())
1567 }
1568 fn clear(&mut self) {
1569 self.name.clear();
1570 self.authentication_type = ::buffa::EnumValue::from(0);
1571 self.owner = ::core::option::Option::None;
1572 self.comment = ::core::option::Option::None;
1573 self.recipient_profile_str = ::core::option::Option::None;
1574 self.properties.clear();
1575 self.__buffa_unknown_fields.clear();
1576 }
1577}
1578impl ::buffa::ExtensionSet for CreateProviderRequest {
1579 const PROTO_FQN: &'static str = "unitycatalog.providers.v1.CreateProviderRequest";
1580 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1581 &self.__buffa_unknown_fields
1582 }
1583 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1584 &mut self.__buffa_unknown_fields
1585 }
1586}
1587impl ::buffa::json_helpers::ProtoElemJson for CreateProviderRequest {
1588 fn serialize_proto_json<S: ::serde::Serializer>(
1589 v: &Self,
1590 s: S,
1591 ) -> ::core::result::Result<S::Ok, S::Error> {
1592 ::serde::Serialize::serialize(v, s)
1593 }
1594 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1595 d: D,
1596 ) -> ::core::result::Result<Self, D::Error> {
1597 <Self as ::serde::Deserialize>::deserialize(d)
1598 }
1599}
1600#[doc(hidden)]
1601pub const __CREATE_PROVIDER_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1602 type_url: "type.googleapis.com/unitycatalog.providers.v1.CreateProviderRequest",
1603 to_json: ::buffa::type_registry::any_to_json::<CreateProviderRequest>,
1604 from_json: ::buffa::type_registry::any_from_json::<CreateProviderRequest>,
1605 is_wkt: false,
1606};
1607#[derive(Clone, PartialEq, Default)]
1609#[derive(::serde::Serialize, ::serde::Deserialize)]
1610#[serde(default)]
1611pub struct GetProviderRequest {
1612 #[serde(
1616 rename = "name",
1617 with = "::buffa::json_helpers::proto_string",
1618 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1619 )]
1620 pub name: ::buffa::alloc::string::String,
1621 #[serde(skip)]
1622 #[doc(hidden)]
1623 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1624}
1625impl ::core::fmt::Debug for GetProviderRequest {
1626 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1627 f.debug_struct("GetProviderRequest").field("name", &self.name).finish()
1628 }
1629}
1630impl GetProviderRequest {
1631 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.GetProviderRequest";
1636}
1637impl ::buffa::DefaultInstance for GetProviderRequest {
1638 fn default_instance() -> &'static Self {
1639 static VALUE: ::buffa::__private::OnceBox<GetProviderRequest> = ::buffa::__private::OnceBox::new();
1640 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1641 }
1642}
1643impl ::buffa::MessageName for GetProviderRequest {
1644 const PACKAGE: &'static str = "unitycatalog.providers.v1";
1645 const NAME: &'static str = "GetProviderRequest";
1646 const FULL_NAME: &'static str = "unitycatalog.providers.v1.GetProviderRequest";
1647 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.GetProviderRequest";
1648}
1649impl ::buffa::Message for GetProviderRequest {
1650 #[allow(clippy::let_and_return)]
1656 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1657 #[allow(unused_imports)]
1658 use ::buffa::Enumeration as _;
1659 let mut size = 0u32;
1660 if !self.name.is_empty() {
1661 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
1662 }
1663 size += self.__buffa_unknown_fields.encoded_len() as u32;
1664 size
1665 }
1666 fn write_to(
1667 &self,
1668 _cache: &mut ::buffa::SizeCache,
1669 buf: &mut impl ::buffa::bytes::BufMut,
1670 ) {
1671 #[allow(unused_imports)]
1672 use ::buffa::Enumeration as _;
1673 if !self.name.is_empty() {
1674 ::buffa::encoding::Tag::new(
1675 1u32,
1676 ::buffa::encoding::WireType::LengthDelimited,
1677 )
1678 .encode(buf);
1679 ::buffa::types::encode_string(&self.name, buf);
1680 }
1681 self.__buffa_unknown_fields.write_to(buf);
1682 }
1683 fn merge_field(
1684 &mut self,
1685 tag: ::buffa::encoding::Tag,
1686 buf: &mut impl ::buffa::bytes::Buf,
1687 depth: u32,
1688 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1689 #[allow(unused_imports)]
1690 use ::buffa::bytes::Buf as _;
1691 #[allow(unused_imports)]
1692 use ::buffa::Enumeration as _;
1693 match tag.field_number() {
1694 1u32 => {
1695 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1696 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1697 field_number: 1u32,
1698 expected: 2u8,
1699 actual: tag.wire_type() as u8,
1700 });
1701 }
1702 ::buffa::types::merge_string(&mut self.name, buf)?;
1703 }
1704 _ => {
1705 self.__buffa_unknown_fields
1706 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1707 }
1708 }
1709 ::core::result::Result::Ok(())
1710 }
1711 fn clear(&mut self) {
1712 self.name.clear();
1713 self.__buffa_unknown_fields.clear();
1714 }
1715}
1716impl ::buffa::ExtensionSet for GetProviderRequest {
1717 const PROTO_FQN: &'static str = "unitycatalog.providers.v1.GetProviderRequest";
1718 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1719 &self.__buffa_unknown_fields
1720 }
1721 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1722 &mut self.__buffa_unknown_fields
1723 }
1724}
1725impl ::buffa::json_helpers::ProtoElemJson for GetProviderRequest {
1726 fn serialize_proto_json<S: ::serde::Serializer>(
1727 v: &Self,
1728 s: S,
1729 ) -> ::core::result::Result<S::Ok, S::Error> {
1730 ::serde::Serialize::serialize(v, s)
1731 }
1732 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1733 d: D,
1734 ) -> ::core::result::Result<Self, D::Error> {
1735 <Self as ::serde::Deserialize>::deserialize(d)
1736 }
1737}
1738#[doc(hidden)]
1739pub const __GET_PROVIDER_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1740 type_url: "type.googleapis.com/unitycatalog.providers.v1.GetProviderRequest",
1741 to_json: ::buffa::type_registry::any_to_json::<GetProviderRequest>,
1742 from_json: ::buffa::type_registry::any_from_json::<GetProviderRequest>,
1743 is_wkt: false,
1744};
1745#[derive(Clone, PartialEq, Default)]
1747#[derive(::serde::Serialize, ::serde::Deserialize)]
1748#[serde(default)]
1749pub struct UpdateProviderRequest {
1750 #[serde(
1754 rename = "name",
1755 with = "::buffa::json_helpers::proto_string",
1756 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1757 )]
1758 pub name: ::buffa::alloc::string::String,
1759 #[serde(
1763 rename = "new_name",
1764 alias = "newName",
1765 skip_serializing_if = "::core::option::Option::is_none"
1766 )]
1767 pub new_name: ::core::option::Option<::buffa::alloc::string::String>,
1768 #[serde(rename = "owner", skip_serializing_if = "::core::option::Option::is_none")]
1772 pub owner: ::core::option::Option<::buffa::alloc::string::String>,
1773 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
1777 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
1778 #[serde(
1783 rename = "recipient_profile_str",
1784 alias = "recipientProfileStr",
1785 skip_serializing_if = "::core::option::Option::is_none"
1786 )]
1787 pub recipient_profile_str: ::core::option::Option<::buffa::alloc::string::String>,
1788 #[serde(
1795 rename = "properties",
1796 skip_serializing_if = "::buffa::__private::HashMap::is_empty",
1797 deserialize_with = "::buffa::json_helpers::null_as_default"
1798 )]
1799 pub properties: ::buffa::__private::HashMap<
1800 ::buffa::alloc::string::String,
1801 ::buffa::alloc::string::String,
1802 >,
1803 #[serde(skip)]
1804 #[doc(hidden)]
1805 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1806}
1807impl ::core::fmt::Debug for UpdateProviderRequest {
1808 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1809 f.debug_struct("UpdateProviderRequest")
1810 .field("name", &self.name)
1811 .field("new_name", &self.new_name)
1812 .field("owner", &self.owner)
1813 .field("comment", &self.comment)
1814 .field("recipient_profile_str", &self.recipient_profile_str)
1815 .field("properties", &self.properties)
1816 .finish()
1817 }
1818}
1819impl UpdateProviderRequest {
1820 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.UpdateProviderRequest";
1825}
1826impl UpdateProviderRequest {
1827 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1828 #[inline]
1829 pub fn with_new_name(
1831 mut self,
1832 value: impl Into<::buffa::alloc::string::String>,
1833 ) -> Self {
1834 self.new_name = Some(value.into());
1835 self
1836 }
1837 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1838 #[inline]
1839 pub fn with_owner(
1841 mut self,
1842 value: impl Into<::buffa::alloc::string::String>,
1843 ) -> Self {
1844 self.owner = Some(value.into());
1845 self
1846 }
1847 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1848 #[inline]
1849 pub fn with_comment(
1851 mut self,
1852 value: impl Into<::buffa::alloc::string::String>,
1853 ) -> Self {
1854 self.comment = Some(value.into());
1855 self
1856 }
1857 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1858 #[inline]
1859 pub fn with_recipient_profile_str(
1861 mut self,
1862 value: impl Into<::buffa::alloc::string::String>,
1863 ) -> Self {
1864 self.recipient_profile_str = Some(value.into());
1865 self
1866 }
1867}
1868impl ::buffa::DefaultInstance for UpdateProviderRequest {
1869 fn default_instance() -> &'static Self {
1870 static VALUE: ::buffa::__private::OnceBox<UpdateProviderRequest> = ::buffa::__private::OnceBox::new();
1871 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1872 }
1873}
1874impl ::buffa::MessageName for UpdateProviderRequest {
1875 const PACKAGE: &'static str = "unitycatalog.providers.v1";
1876 const NAME: &'static str = "UpdateProviderRequest";
1877 const FULL_NAME: &'static str = "unitycatalog.providers.v1.UpdateProviderRequest";
1878 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.UpdateProviderRequest";
1879}
1880impl ::buffa::Message for UpdateProviderRequest {
1881 #[allow(clippy::let_and_return)]
1887 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1888 #[allow(unused_imports)]
1889 use ::buffa::Enumeration as _;
1890 let mut size = 0u32;
1891 if !self.name.is_empty() {
1892 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
1893 }
1894 if let Some(ref v) = self.new_name {
1895 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1896 }
1897 if let Some(ref v) = self.owner {
1898 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1899 }
1900 if let Some(ref v) = self.comment {
1901 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1902 }
1903 if let Some(ref v) = self.recipient_profile_str {
1904 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1905 }
1906 #[allow(clippy::for_kv_map)]
1907 for (k, v) in &self.properties {
1908 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
1909 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1910 size
1911 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
1912 + entry_size;
1913 }
1914 size += self.__buffa_unknown_fields.encoded_len() as u32;
1915 size
1916 }
1917 fn write_to(
1918 &self,
1919 _cache: &mut ::buffa::SizeCache,
1920 buf: &mut impl ::buffa::bytes::BufMut,
1921 ) {
1922 #[allow(unused_imports)]
1923 use ::buffa::Enumeration as _;
1924 if !self.name.is_empty() {
1925 ::buffa::encoding::Tag::new(
1926 1u32,
1927 ::buffa::encoding::WireType::LengthDelimited,
1928 )
1929 .encode(buf);
1930 ::buffa::types::encode_string(&self.name, buf);
1931 }
1932 if let Some(ref v) = self.new_name {
1933 ::buffa::encoding::Tag::new(
1934 2u32,
1935 ::buffa::encoding::WireType::LengthDelimited,
1936 )
1937 .encode(buf);
1938 ::buffa::types::encode_string(v, buf);
1939 }
1940 if let Some(ref v) = self.owner {
1941 ::buffa::encoding::Tag::new(
1942 3u32,
1943 ::buffa::encoding::WireType::LengthDelimited,
1944 )
1945 .encode(buf);
1946 ::buffa::types::encode_string(v, buf);
1947 }
1948 if let Some(ref v) = self.comment {
1949 ::buffa::encoding::Tag::new(
1950 4u32,
1951 ::buffa::encoding::WireType::LengthDelimited,
1952 )
1953 .encode(buf);
1954 ::buffa::types::encode_string(v, buf);
1955 }
1956 if let Some(ref v) = self.recipient_profile_str {
1957 ::buffa::encoding::Tag::new(
1958 5u32,
1959 ::buffa::encoding::WireType::LengthDelimited,
1960 )
1961 .encode(buf);
1962 ::buffa::types::encode_string(v, buf);
1963 }
1964 for (k, v) in &self.properties {
1965 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
1966 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1967 ::buffa::encoding::Tag::new(
1968 6u32,
1969 ::buffa::encoding::WireType::LengthDelimited,
1970 )
1971 .encode(buf);
1972 ::buffa::encoding::encode_varint(entry_size as u64, buf);
1973 ::buffa::encoding::Tag::new(
1974 1u32,
1975 ::buffa::encoding::WireType::LengthDelimited,
1976 )
1977 .encode(buf);
1978 ::buffa::types::encode_string(k, buf);
1979 ::buffa::encoding::Tag::new(
1980 2u32,
1981 ::buffa::encoding::WireType::LengthDelimited,
1982 )
1983 .encode(buf);
1984 ::buffa::types::encode_string(v, buf);
1985 }
1986 self.__buffa_unknown_fields.write_to(buf);
1987 }
1988 fn merge_field(
1989 &mut self,
1990 tag: ::buffa::encoding::Tag,
1991 buf: &mut impl ::buffa::bytes::Buf,
1992 depth: u32,
1993 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1994 #[allow(unused_imports)]
1995 use ::buffa::bytes::Buf as _;
1996 #[allow(unused_imports)]
1997 use ::buffa::Enumeration as _;
1998 match tag.field_number() {
1999 1u32 => {
2000 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2001 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2002 field_number: 1u32,
2003 expected: 2u8,
2004 actual: tag.wire_type() as u8,
2005 });
2006 }
2007 ::buffa::types::merge_string(&mut self.name, buf)?;
2008 }
2009 2u32 => {
2010 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2011 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2012 field_number: 2u32,
2013 expected: 2u8,
2014 actual: tag.wire_type() as u8,
2015 });
2016 }
2017 ::buffa::types::merge_string(
2018 self
2019 .new_name
2020 .get_or_insert_with(::buffa::alloc::string::String::new),
2021 buf,
2022 )?;
2023 }
2024 3u32 => {
2025 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2026 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2027 field_number: 3u32,
2028 expected: 2u8,
2029 actual: tag.wire_type() as u8,
2030 });
2031 }
2032 ::buffa::types::merge_string(
2033 self.owner.get_or_insert_with(::buffa::alloc::string::String::new),
2034 buf,
2035 )?;
2036 }
2037 4u32 => {
2038 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2039 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2040 field_number: 4u32,
2041 expected: 2u8,
2042 actual: tag.wire_type() as u8,
2043 });
2044 }
2045 ::buffa::types::merge_string(
2046 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
2047 buf,
2048 )?;
2049 }
2050 5u32 => {
2051 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2052 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2053 field_number: 5u32,
2054 expected: 2u8,
2055 actual: tag.wire_type() as u8,
2056 });
2057 }
2058 ::buffa::types::merge_string(
2059 self
2060 .recipient_profile_str
2061 .get_or_insert_with(::buffa::alloc::string::String::new),
2062 buf,
2063 )?;
2064 }
2065 6u32 => {
2066 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2067 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2068 field_number: 6u32,
2069 expected: 2u8,
2070 actual: tag.wire_type() as u8,
2071 });
2072 }
2073 let entry_len = ::buffa::encoding::decode_varint(buf)?;
2074 let entry_len = usize::try_from(entry_len)
2075 .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
2076 if buf.remaining() < entry_len {
2077 return ::core::result::Result::Err(
2078 ::buffa::DecodeError::UnexpectedEof,
2079 );
2080 }
2081 let entry_limit = buf.remaining() - entry_len;
2082 let mut key = ::core::default::Default::default();
2083 let mut val = ::core::default::Default::default();
2084 while buf.remaining() > entry_limit {
2085 let entry_tag = ::buffa::encoding::Tag::decode(buf)?;
2086 match entry_tag.field_number() {
2087 1 => {
2088 if entry_tag.wire_type()
2089 != ::buffa::encoding::WireType::LengthDelimited
2090 {
2091 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2092 field_number: entry_tag.field_number(),
2093 expected: 2u8,
2094 actual: entry_tag.wire_type() as u8,
2095 });
2096 }
2097 key = ::buffa::types::decode_string(buf)?;
2098 }
2099 2 => {
2100 if entry_tag.wire_type()
2101 != ::buffa::encoding::WireType::LengthDelimited
2102 {
2103 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2104 field_number: entry_tag.field_number(),
2105 expected: 2u8,
2106 actual: entry_tag.wire_type() as u8,
2107 });
2108 }
2109 val = ::buffa::types::decode_string(buf)?;
2110 }
2111 _ => {
2112 ::buffa::encoding::skip_field_depth(entry_tag, buf, depth)?;
2113 }
2114 }
2115 }
2116 if buf.remaining() != entry_limit {
2117 let remaining = buf.remaining();
2118 if remaining > entry_limit {
2119 buf.advance(remaining - entry_limit);
2120 } else {
2121 return ::core::result::Result::Err(
2122 ::buffa::DecodeError::UnexpectedEof,
2123 );
2124 }
2125 }
2126 self.properties.insert(key, val);
2127 }
2128 _ => {
2129 self.__buffa_unknown_fields
2130 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2131 }
2132 }
2133 ::core::result::Result::Ok(())
2134 }
2135 fn clear(&mut self) {
2136 self.name.clear();
2137 self.new_name = ::core::option::Option::None;
2138 self.owner = ::core::option::Option::None;
2139 self.comment = ::core::option::Option::None;
2140 self.recipient_profile_str = ::core::option::Option::None;
2141 self.properties.clear();
2142 self.__buffa_unknown_fields.clear();
2143 }
2144}
2145impl ::buffa::ExtensionSet for UpdateProviderRequest {
2146 const PROTO_FQN: &'static str = "unitycatalog.providers.v1.UpdateProviderRequest";
2147 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2148 &self.__buffa_unknown_fields
2149 }
2150 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2151 &mut self.__buffa_unknown_fields
2152 }
2153}
2154impl ::buffa::json_helpers::ProtoElemJson for UpdateProviderRequest {
2155 fn serialize_proto_json<S: ::serde::Serializer>(
2156 v: &Self,
2157 s: S,
2158 ) -> ::core::result::Result<S::Ok, S::Error> {
2159 ::serde::Serialize::serialize(v, s)
2160 }
2161 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2162 d: D,
2163 ) -> ::core::result::Result<Self, D::Error> {
2164 <Self as ::serde::Deserialize>::deserialize(d)
2165 }
2166}
2167#[doc(hidden)]
2168pub const __UPDATE_PROVIDER_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2169 type_url: "type.googleapis.com/unitycatalog.providers.v1.UpdateProviderRequest",
2170 to_json: ::buffa::type_registry::any_to_json::<UpdateProviderRequest>,
2171 from_json: ::buffa::type_registry::any_from_json::<UpdateProviderRequest>,
2172 is_wkt: false,
2173};
2174#[derive(Clone, PartialEq, Default)]
2176#[derive(::serde::Serialize, ::serde::Deserialize)]
2177#[serde(default)]
2178pub struct DeleteProviderRequest {
2179 #[serde(
2183 rename = "name",
2184 with = "::buffa::json_helpers::proto_string",
2185 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2186 )]
2187 pub name: ::buffa::alloc::string::String,
2188 #[serde(skip)]
2189 #[doc(hidden)]
2190 pub __buffa_unknown_fields: ::buffa::UnknownFields,
2191}
2192impl ::core::fmt::Debug for DeleteProviderRequest {
2193 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2194 f.debug_struct("DeleteProviderRequest").field("name", &self.name).finish()
2195 }
2196}
2197impl DeleteProviderRequest {
2198 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.DeleteProviderRequest";
2203}
2204impl ::buffa::DefaultInstance for DeleteProviderRequest {
2205 fn default_instance() -> &'static Self {
2206 static VALUE: ::buffa::__private::OnceBox<DeleteProviderRequest> = ::buffa::__private::OnceBox::new();
2207 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2208 }
2209}
2210impl ::buffa::MessageName for DeleteProviderRequest {
2211 const PACKAGE: &'static str = "unitycatalog.providers.v1";
2212 const NAME: &'static str = "DeleteProviderRequest";
2213 const FULL_NAME: &'static str = "unitycatalog.providers.v1.DeleteProviderRequest";
2214 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.DeleteProviderRequest";
2215}
2216impl ::buffa::Message for DeleteProviderRequest {
2217 #[allow(clippy::let_and_return)]
2223 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2224 #[allow(unused_imports)]
2225 use ::buffa::Enumeration as _;
2226 let mut size = 0u32;
2227 if !self.name.is_empty() {
2228 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
2229 }
2230 size += self.__buffa_unknown_fields.encoded_len() as u32;
2231 size
2232 }
2233 fn write_to(
2234 &self,
2235 _cache: &mut ::buffa::SizeCache,
2236 buf: &mut impl ::buffa::bytes::BufMut,
2237 ) {
2238 #[allow(unused_imports)]
2239 use ::buffa::Enumeration as _;
2240 if !self.name.is_empty() {
2241 ::buffa::encoding::Tag::new(
2242 1u32,
2243 ::buffa::encoding::WireType::LengthDelimited,
2244 )
2245 .encode(buf);
2246 ::buffa::types::encode_string(&self.name, buf);
2247 }
2248 self.__buffa_unknown_fields.write_to(buf);
2249 }
2250 fn merge_field(
2251 &mut self,
2252 tag: ::buffa::encoding::Tag,
2253 buf: &mut impl ::buffa::bytes::Buf,
2254 depth: u32,
2255 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2256 #[allow(unused_imports)]
2257 use ::buffa::bytes::Buf as _;
2258 #[allow(unused_imports)]
2259 use ::buffa::Enumeration as _;
2260 match tag.field_number() {
2261 1u32 => {
2262 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2263 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2264 field_number: 1u32,
2265 expected: 2u8,
2266 actual: tag.wire_type() as u8,
2267 });
2268 }
2269 ::buffa::types::merge_string(&mut self.name, buf)?;
2270 }
2271 _ => {
2272 self.__buffa_unknown_fields
2273 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2274 }
2275 }
2276 ::core::result::Result::Ok(())
2277 }
2278 fn clear(&mut self) {
2279 self.name.clear();
2280 self.__buffa_unknown_fields.clear();
2281 }
2282}
2283impl ::buffa::ExtensionSet for DeleteProviderRequest {
2284 const PROTO_FQN: &'static str = "unitycatalog.providers.v1.DeleteProviderRequest";
2285 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2286 &self.__buffa_unknown_fields
2287 }
2288 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2289 &mut self.__buffa_unknown_fields
2290 }
2291}
2292impl ::buffa::json_helpers::ProtoElemJson for DeleteProviderRequest {
2293 fn serialize_proto_json<S: ::serde::Serializer>(
2294 v: &Self,
2295 s: S,
2296 ) -> ::core::result::Result<S::Ok, S::Error> {
2297 ::serde::Serialize::serialize(v, s)
2298 }
2299 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2300 d: D,
2301 ) -> ::core::result::Result<Self, D::Error> {
2302 <Self as ::serde::Deserialize>::deserialize(d)
2303 }
2304}
2305#[doc(hidden)]
2306pub const __DELETE_PROVIDER_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2307 type_url: "type.googleapis.com/unitycatalog.providers.v1.DeleteProviderRequest",
2308 to_json: ::buffa::type_registry::any_to_json::<DeleteProviderRequest>,
2309 from_json: ::buffa::type_registry::any_from_json::<DeleteProviderRequest>,
2310 is_wkt: false,
2311};
2312#[allow(
2313 non_camel_case_types,
2314 dead_code,
2315 unused_imports,
2316 unused_qualifications,
2317 clippy::derivable_impls,
2318 clippy::match_single_binding,
2319 clippy::uninlined_format_args,
2320 clippy::doc_lazy_continuation,
2321 clippy::module_inception
2322)]
2323pub mod __buffa {
2324 #[allow(unused_imports)]
2325 use super::*;
2326 pub mod view {
2327 #[allow(unused_imports)]
2328 use super::*;
2329 #[derive(Clone, Debug, Default)]
2335 pub struct ProviderView<'a> {
2336 pub id: ::core::option::Option<&'a str>,
2340 pub name: &'a str,
2344 pub authentication_type: ::buffa::EnumValue<
2348 super::super::ProviderAuthenticationType,
2349 >,
2350 pub owner: ::core::option::Option<&'a str>,
2354 pub comment: ::core::option::Option<&'a str>,
2358 pub recipient_profile_str: ::core::option::Option<&'a str>,
2363 pub properties: ::buffa::MapView<'a, &'a str, &'a str>,
2367 pub created_at: ::core::option::Option<i64>,
2371 pub created_by: ::core::option::Option<&'a str>,
2375 pub updated_at: ::core::option::Option<i64>,
2379 pub updated_by: ::core::option::Option<&'a str>,
2383 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2384 }
2385 impl<'a> ProviderView<'a> {
2386 #[doc(hidden)]
2394 pub fn _decode_depth(
2395 buf: &'a [u8],
2396 depth: u32,
2397 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2398 let mut view = Self::default();
2399 view._merge_into_view(buf, depth)?;
2400 ::core::result::Result::Ok(view)
2401 }
2402 #[doc(hidden)]
2410 pub fn _merge_into_view(
2411 &mut self,
2412 buf: &'a [u8],
2413 depth: u32,
2414 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2415 let _ = depth;
2416 #[allow(unused_variables)]
2417 let view = self;
2418 let mut cur: &'a [u8] = buf;
2419 while !cur.is_empty() {
2420 let before_tag = cur;
2421 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
2422 match tag.field_number() {
2423 100u32 => {
2424 if tag.wire_type()
2425 != ::buffa::encoding::WireType::LengthDelimited
2426 {
2427 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2428 field_number: 100u32,
2429 expected: 2u8,
2430 actual: tag.wire_type() as u8,
2431 });
2432 }
2433 view.id = Some(::buffa::types::borrow_str(&mut cur)?);
2434 }
2435 1u32 => {
2436 if tag.wire_type()
2437 != ::buffa::encoding::WireType::LengthDelimited
2438 {
2439 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2440 field_number: 1u32,
2441 expected: 2u8,
2442 actual: tag.wire_type() as u8,
2443 });
2444 }
2445 view.name = ::buffa::types::borrow_str(&mut cur)?;
2446 }
2447 2u32 => {
2448 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2449 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2450 field_number: 2u32,
2451 expected: 0u8,
2452 actual: tag.wire_type() as u8,
2453 });
2454 }
2455 view.authentication_type = ::buffa::EnumValue::from(
2456 ::buffa::types::decode_int32(&mut cur)?,
2457 );
2458 }
2459 3u32 => {
2460 if tag.wire_type()
2461 != ::buffa::encoding::WireType::LengthDelimited
2462 {
2463 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2464 field_number: 3u32,
2465 expected: 2u8,
2466 actual: tag.wire_type() as u8,
2467 });
2468 }
2469 view.owner = Some(::buffa::types::borrow_str(&mut cur)?);
2470 }
2471 4u32 => {
2472 if tag.wire_type()
2473 != ::buffa::encoding::WireType::LengthDelimited
2474 {
2475 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2476 field_number: 4u32,
2477 expected: 2u8,
2478 actual: tag.wire_type() as u8,
2479 });
2480 }
2481 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
2482 }
2483 5u32 => {
2484 if tag.wire_type()
2485 != ::buffa::encoding::WireType::LengthDelimited
2486 {
2487 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2488 field_number: 5u32,
2489 expected: 2u8,
2490 actual: tag.wire_type() as u8,
2491 });
2492 }
2493 view.recipient_profile_str = Some(
2494 ::buffa::types::borrow_str(&mut cur)?,
2495 );
2496 }
2497 7u32 => {
2498 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2499 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2500 field_number: 7u32,
2501 expected: 0u8,
2502 actual: tag.wire_type() as u8,
2503 });
2504 }
2505 view.created_at = Some(
2506 ::buffa::types::decode_int64(&mut cur)?,
2507 );
2508 }
2509 8u32 => {
2510 if tag.wire_type()
2511 != ::buffa::encoding::WireType::LengthDelimited
2512 {
2513 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2514 field_number: 8u32,
2515 expected: 2u8,
2516 actual: tag.wire_type() as u8,
2517 });
2518 }
2519 view.created_by = Some(
2520 ::buffa::types::borrow_str(&mut cur)?,
2521 );
2522 }
2523 9u32 => {
2524 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2525 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2526 field_number: 9u32,
2527 expected: 0u8,
2528 actual: tag.wire_type() as u8,
2529 });
2530 }
2531 view.updated_at = Some(
2532 ::buffa::types::decode_int64(&mut cur)?,
2533 );
2534 }
2535 10u32 => {
2536 if tag.wire_type()
2537 != ::buffa::encoding::WireType::LengthDelimited
2538 {
2539 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2540 field_number: 10u32,
2541 expected: 2u8,
2542 actual: tag.wire_type() as u8,
2543 });
2544 }
2545 view.updated_by = Some(
2546 ::buffa::types::borrow_str(&mut cur)?,
2547 );
2548 }
2549 6u32 => {
2550 if tag.wire_type()
2551 != ::buffa::encoding::WireType::LengthDelimited
2552 {
2553 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2554 field_number: 6u32,
2555 expected: 2u8,
2556 actual: tag.wire_type() as u8,
2557 });
2558 }
2559 let entry_bytes = ::buffa::types::borrow_bytes(&mut cur)?;
2560 let mut entry_cur: &'a [u8] = entry_bytes;
2561 let mut key = "";
2562 let mut val = "";
2563 while !entry_cur.is_empty() {
2564 let entry_tag = ::buffa::encoding::Tag::decode(
2565 &mut entry_cur,
2566 )?;
2567 match entry_tag.field_number() {
2568 1 => {
2569 if entry_tag.wire_type()
2570 != ::buffa::encoding::WireType::LengthDelimited
2571 {
2572 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2573 field_number: entry_tag.field_number(),
2574 expected: 2u8,
2575 actual: entry_tag.wire_type() as u8,
2576 });
2577 }
2578 key = ::buffa::types::borrow_str(&mut entry_cur)?;
2579 }
2580 2 => {
2581 if entry_tag.wire_type()
2582 != ::buffa::encoding::WireType::LengthDelimited
2583 {
2584 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2585 field_number: entry_tag.field_number(),
2586 expected: 2u8,
2587 actual: entry_tag.wire_type() as u8,
2588 });
2589 }
2590 val = ::buffa::types::borrow_str(&mut entry_cur)?;
2591 }
2592 _ => {
2593 ::buffa::encoding::skip_field_depth(
2594 entry_tag,
2595 &mut entry_cur,
2596 depth,
2597 )?;
2598 }
2599 }
2600 }
2601 view.properties.push(key, val);
2602 }
2603 _ => {
2604 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
2605 let span_len = before_tag.len() - cur.len();
2606 view.__buffa_unknown_fields
2607 .push_raw(&before_tag[..span_len]);
2608 }
2609 }
2610 }
2611 ::core::result::Result::Ok(())
2612 }
2613 }
2614 impl<'a> ::buffa::MessageView<'a> for ProviderView<'a> {
2615 type Owned = super::super::Provider;
2616 fn decode_view(
2617 buf: &'a [u8],
2618 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2619 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
2620 }
2621 fn decode_view_with_limit(
2622 buf: &'a [u8],
2623 depth: u32,
2624 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2625 Self::_decode_depth(buf, depth)
2626 }
2627 fn to_owned_message(&self) -> super::super::Provider {
2628 self.to_owned_from_source(None)
2629 }
2630 #[allow(clippy::useless_conversion, clippy::needless_update)]
2631 fn to_owned_from_source(
2632 &self,
2633 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
2634 ) -> super::super::Provider {
2635 #[allow(unused_imports)]
2636 use ::buffa::alloc::string::ToString as _;
2637 let _ = __buffa_src;
2638 super::super::Provider {
2639 id: self.id.map(|s| s.to_string()),
2640 name: self.name.to_string(),
2641 authentication_type: self.authentication_type,
2642 owner: self.owner.map(|s| s.to_string()),
2643 comment: self.comment.map(|s| s.to_string()),
2644 recipient_profile_str: self
2645 .recipient_profile_str
2646 .map(|s| s.to_string()),
2647 properties: self
2648 .properties
2649 .iter()
2650 .map(|(k, v)| (k.to_string(), v.to_string()))
2651 .collect(),
2652 created_at: self.created_at,
2653 created_by: self.created_by.map(|s| s.to_string()),
2654 updated_at: self.updated_at,
2655 updated_by: self.updated_by.map(|s| s.to_string()),
2656 __buffa_unknown_fields: self
2657 .__buffa_unknown_fields
2658 .to_owned()
2659 .unwrap_or_default()
2660 .into(),
2661 ..::core::default::Default::default()
2662 }
2663 }
2664 }
2665 impl<'a> ::buffa::ViewEncode<'a> for ProviderView<'a> {
2666 #[allow(clippy::needless_borrow, clippy::let_and_return)]
2667 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2668 #[allow(unused_imports)]
2669 use ::buffa::Enumeration as _;
2670 let mut size = 0u32;
2671 if !self.name.is_empty() {
2672 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
2673 }
2674 {
2675 let val = self.authentication_type.to_i32();
2676 if val != 0 {
2677 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
2678 }
2679 }
2680 if let Some(ref v) = self.owner {
2681 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2682 }
2683 if let Some(ref v) = self.comment {
2684 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2685 }
2686 if let Some(ref v) = self.recipient_profile_str {
2687 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2688 }
2689 #[allow(clippy::for_kv_map)]
2690 for (k, v) in &self.properties {
2691 let entry_size: u32 = 1u32
2692 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
2693 + ::buffa::types::string_encoded_len(v) as u32;
2694 size
2695 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
2696 + entry_size;
2697 }
2698 if let Some(v) = self.created_at {
2699 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
2700 }
2701 if let Some(ref v) = self.created_by {
2702 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2703 }
2704 if let Some(v) = self.updated_at {
2705 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
2706 }
2707 if let Some(ref v) = self.updated_by {
2708 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2709 }
2710 if let Some(ref v) = self.id {
2711 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
2712 }
2713 size += self.__buffa_unknown_fields.encoded_len() as u32;
2714 size
2715 }
2716 #[allow(clippy::needless_borrow)]
2717 fn write_to(
2718 &self,
2719 _cache: &mut ::buffa::SizeCache,
2720 buf: &mut impl ::buffa::bytes::BufMut,
2721 ) {
2722 #[allow(unused_imports)]
2723 use ::buffa::Enumeration as _;
2724 if !self.name.is_empty() {
2725 ::buffa::encoding::Tag::new(
2726 1u32,
2727 ::buffa::encoding::WireType::LengthDelimited,
2728 )
2729 .encode(buf);
2730 ::buffa::types::encode_string(&self.name, buf);
2731 }
2732 {
2733 let val = self.authentication_type.to_i32();
2734 if val != 0 {
2735 ::buffa::encoding::Tag::new(
2736 2u32,
2737 ::buffa::encoding::WireType::Varint,
2738 )
2739 .encode(buf);
2740 ::buffa::types::encode_int32(val, buf);
2741 }
2742 }
2743 if let Some(ref v) = self.owner {
2744 ::buffa::encoding::Tag::new(
2745 3u32,
2746 ::buffa::encoding::WireType::LengthDelimited,
2747 )
2748 .encode(buf);
2749 ::buffa::types::encode_string(v, buf);
2750 }
2751 if let Some(ref v) = self.comment {
2752 ::buffa::encoding::Tag::new(
2753 4u32,
2754 ::buffa::encoding::WireType::LengthDelimited,
2755 )
2756 .encode(buf);
2757 ::buffa::types::encode_string(v, buf);
2758 }
2759 if let Some(ref v) = self.recipient_profile_str {
2760 ::buffa::encoding::Tag::new(
2761 5u32,
2762 ::buffa::encoding::WireType::LengthDelimited,
2763 )
2764 .encode(buf);
2765 ::buffa::types::encode_string(v, buf);
2766 }
2767 for (k, v) in &self.properties {
2768 let entry_size: u32 = 1u32
2769 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
2770 + ::buffa::types::string_encoded_len(v) as u32;
2771 ::buffa::encoding::Tag::new(
2772 6u32,
2773 ::buffa::encoding::WireType::LengthDelimited,
2774 )
2775 .encode(buf);
2776 ::buffa::encoding::encode_varint(entry_size as u64, buf);
2777 ::buffa::encoding::Tag::new(
2778 1u32,
2779 ::buffa::encoding::WireType::LengthDelimited,
2780 )
2781 .encode(buf);
2782 ::buffa::types::encode_string(k, buf);
2783 ::buffa::encoding::Tag::new(
2784 2u32,
2785 ::buffa::encoding::WireType::LengthDelimited,
2786 )
2787 .encode(buf);
2788 ::buffa::types::encode_string(v, buf);
2789 }
2790 if let Some(v) = self.created_at {
2791 ::buffa::encoding::Tag::new(
2792 7u32,
2793 ::buffa::encoding::WireType::Varint,
2794 )
2795 .encode(buf);
2796 ::buffa::types::encode_int64(v, buf);
2797 }
2798 if let Some(ref v) = self.created_by {
2799 ::buffa::encoding::Tag::new(
2800 8u32,
2801 ::buffa::encoding::WireType::LengthDelimited,
2802 )
2803 .encode(buf);
2804 ::buffa::types::encode_string(v, buf);
2805 }
2806 if let Some(v) = self.updated_at {
2807 ::buffa::encoding::Tag::new(
2808 9u32,
2809 ::buffa::encoding::WireType::Varint,
2810 )
2811 .encode(buf);
2812 ::buffa::types::encode_int64(v, buf);
2813 }
2814 if let Some(ref v) = self.updated_by {
2815 ::buffa::encoding::Tag::new(
2816 10u32,
2817 ::buffa::encoding::WireType::LengthDelimited,
2818 )
2819 .encode(buf);
2820 ::buffa::types::encode_string(v, buf);
2821 }
2822 if let Some(ref v) = self.id {
2823 ::buffa::encoding::Tag::new(
2824 100u32,
2825 ::buffa::encoding::WireType::LengthDelimited,
2826 )
2827 .encode(buf);
2828 ::buffa::types::encode_string(v, buf);
2829 }
2830 self.__buffa_unknown_fields.write_to(buf);
2831 }
2832 }
2833 impl<'__a> ::serde::Serialize for ProviderView<'__a> {
2845 fn serialize<__S: ::serde::Serializer>(
2846 &self,
2847 __s: __S,
2848 ) -> ::core::result::Result<__S::Ok, __S::Error> {
2849 use ::serde::ser::SerializeMap as _;
2850 let mut __map = __s.serialize_map(::core::option::Option::None)?;
2851 if let ::core::option::Option::Some(__v) = self.id {
2852 __map.serialize_entry("id", __v)?;
2853 }
2854 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
2855 __map.serialize_entry("name", self.name)?;
2856 }
2857 if !::buffa::json_helpers::skip_if::is_default_enum_value(
2858 &self.authentication_type,
2859 ) {
2860 __map
2861 .serialize_entry(
2862 "authenticationType",
2863 &self.authentication_type,
2864 )?;
2865 }
2866 if let ::core::option::Option::Some(__v) = self.owner {
2867 __map.serialize_entry("owner", __v)?;
2868 }
2869 if let ::core::option::Option::Some(__v) = self.comment {
2870 __map.serialize_entry("comment", __v)?;
2871 }
2872 if let ::core::option::Option::Some(__v) = self.recipient_profile_str {
2873 __map.serialize_entry("recipient_profile_str", __v)?;
2874 }
2875 if !self.properties.is_empty() {
2876 struct _WM<'__a, '__x>(
2877 &'__x ::buffa::MapView<'__x, &'__a str, &'__a str>,
2878 );
2879 impl<'__a> ::serde::Serialize for _WM<'__a, '_> {
2880 fn serialize<__S: ::serde::Serializer>(
2881 &self,
2882 __s: __S,
2883 ) -> ::core::result::Result<__S::Ok, __S::Error> {
2884 use ::serde::ser::SerializeMap as _;
2885 let mut __m = __s
2886 .serialize_map(::core::option::Option::Some(self.0.len()))?;
2887 for (k, v) in self.0.iter_unique() {
2888 __m.serialize_entry(k, v)?;
2889 }
2890 __m.end()
2891 }
2892 }
2893 __map.serialize_entry("properties", &_WM(&self.properties))?;
2894 }
2895 if let ::core::option::Option::Some(__v) = self.created_at {
2896 struct _W(i64);
2897 impl ::serde::Serialize for _W {
2898 fn serialize<__S: ::serde::Serializer>(
2899 &self,
2900 __s: __S,
2901 ) -> ::core::result::Result<__S::Ok, __S::Error> {
2902 ::buffa::json_helpers::int64::serialize(&self.0, __s)
2903 }
2904 }
2905 __map.serialize_entry("created_at", &_W(__v))?;
2906 }
2907 if let ::core::option::Option::Some(__v) = self.created_by {
2908 __map.serialize_entry("created_by", __v)?;
2909 }
2910 if let ::core::option::Option::Some(__v) = self.updated_at {
2911 struct _W(i64);
2912 impl ::serde::Serialize for _W {
2913 fn serialize<__S: ::serde::Serializer>(
2914 &self,
2915 __s: __S,
2916 ) -> ::core::result::Result<__S::Ok, __S::Error> {
2917 ::buffa::json_helpers::int64::serialize(&self.0, __s)
2918 }
2919 }
2920 __map.serialize_entry("updated_at", &_W(__v))?;
2921 }
2922 if let ::core::option::Option::Some(__v) = self.updated_by {
2923 __map.serialize_entry("updated_by", __v)?;
2924 }
2925 __map.end()
2926 }
2927 }
2928 impl<'a> ::buffa::MessageName for ProviderView<'a> {
2929 const PACKAGE: &'static str = "unitycatalog.providers.v1";
2930 const NAME: &'static str = "Provider";
2931 const FULL_NAME: &'static str = "unitycatalog.providers.v1.Provider";
2932 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.Provider";
2933 }
2934 impl<'v> ::buffa::DefaultViewInstance for ProviderView<'v> {
2935 fn default_view_instance<'a>() -> &'a Self
2936 where
2937 Self: 'a,
2938 {
2939 static VALUE: ::buffa::__private::OnceBox<ProviderView<'static>> = ::buffa::__private::OnceBox::new();
2940 VALUE
2941 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
2942 <ProviderView<'static>>::default(),
2943 ))
2944 }
2945 }
2946 impl ::buffa::ViewReborrow for ProviderView<'static> {
2947 type Reborrowed<'b> = ProviderView<'b>;
2948 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
2949 this
2950 }
2951 }
2952 #[derive(Clone, Debug)]
2958 pub struct ProviderOwnedView(::buffa::OwnedView<ProviderView<'static>>);
2959 impl ProviderOwnedView {
2960 pub fn decode(
2970 bytes: ::buffa::bytes::Bytes,
2971 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2972 ::core::result::Result::Ok(
2973 ProviderOwnedView(::buffa::OwnedView::decode(bytes)?),
2974 )
2975 }
2976 pub fn decode_with_options(
2984 bytes: ::buffa::bytes::Bytes,
2985 opts: &::buffa::DecodeOptions,
2986 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2987 ::core::result::Result::Ok(
2988 ProviderOwnedView(
2989 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
2990 ),
2991 )
2992 }
2993 pub fn from_owned(
3000 msg: &super::super::Provider,
3001 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3002 ::core::result::Result::Ok(
3003 ProviderOwnedView(::buffa::OwnedView::from_owned(msg)?),
3004 )
3005 }
3006 #[must_use]
3008 pub fn view(&self) -> &ProviderView<'_> {
3009 self.0.reborrow()
3010 }
3011 #[must_use]
3013 pub fn to_owned_message(&self) -> super::super::Provider {
3014 self.0.to_owned_message()
3015 }
3016 #[must_use]
3018 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3019 self.0.bytes()
3020 }
3021 #[must_use]
3023 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3024 self.0.into_bytes()
3025 }
3026 #[must_use]
3030 pub fn id(&self) -> ::core::option::Option<&'_ str> {
3031 self.0.reborrow().id
3032 }
3033 #[must_use]
3037 pub fn name(&self) -> &'_ str {
3038 self.0.reborrow().name
3039 }
3040 #[must_use]
3044 pub fn authentication_type(
3045 &self,
3046 ) -> ::buffa::EnumValue<super::super::ProviderAuthenticationType> {
3047 self.0.reborrow().authentication_type
3048 }
3049 #[must_use]
3053 pub fn owner(&self) -> ::core::option::Option<&'_ str> {
3054 self.0.reborrow().owner
3055 }
3056 #[must_use]
3060 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
3061 self.0.reborrow().comment
3062 }
3063 #[must_use]
3068 pub fn recipient_profile_str(&self) -> ::core::option::Option<&'_ str> {
3069 self.0.reborrow().recipient_profile_str
3070 }
3071 #[must_use]
3075 pub fn properties(&self) -> &::buffa::MapView<'_, &'_ str, &'_ str> {
3076 &self.0.reborrow().properties
3077 }
3078 #[must_use]
3082 pub fn created_at(&self) -> ::core::option::Option<i64> {
3083 self.0.reborrow().created_at
3084 }
3085 #[must_use]
3089 pub fn created_by(&self) -> ::core::option::Option<&'_ str> {
3090 self.0.reborrow().created_by
3091 }
3092 #[must_use]
3096 pub fn updated_at(&self) -> ::core::option::Option<i64> {
3097 self.0.reborrow().updated_at
3098 }
3099 #[must_use]
3103 pub fn updated_by(&self) -> ::core::option::Option<&'_ str> {
3104 self.0.reborrow().updated_by
3105 }
3106 }
3107 impl ::core::convert::From<::buffa::OwnedView<ProviderView<'static>>>
3108 for ProviderOwnedView {
3109 fn from(inner: ::buffa::OwnedView<ProviderView<'static>>) -> Self {
3110 ProviderOwnedView(inner)
3111 }
3112 }
3113 impl ::core::convert::From<ProviderOwnedView>
3114 for ::buffa::OwnedView<ProviderView<'static>> {
3115 fn from(wrapper: ProviderOwnedView) -> Self {
3116 wrapper.0
3117 }
3118 }
3119 impl ::core::convert::AsRef<::buffa::OwnedView<ProviderView<'static>>>
3120 for ProviderOwnedView {
3121 fn as_ref(&self) -> &::buffa::OwnedView<ProviderView<'static>> {
3122 &self.0
3123 }
3124 }
3125 impl ::buffa::HasMessageView for super::super::Provider {
3126 type View<'a> = ProviderView<'a>;
3127 type ViewHandle = ProviderOwnedView;
3128 }
3129 impl ::serde::Serialize for ProviderOwnedView {
3130 fn serialize<__S: ::serde::Serializer>(
3131 &self,
3132 __s: __S,
3133 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3134 ::serde::Serialize::serialize(&self.0, __s)
3135 }
3136 }
3137 #[derive(Clone, Debug, Default)]
3139 pub struct ListProvidersRequestView<'a> {
3140 pub max_results: ::core::option::Option<i32>,
3144 pub page_token: ::core::option::Option<&'a str>,
3148 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
3149 }
3150 impl<'a> ListProvidersRequestView<'a> {
3151 #[doc(hidden)]
3159 pub fn _decode_depth(
3160 buf: &'a [u8],
3161 depth: u32,
3162 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3163 let mut view = Self::default();
3164 view._merge_into_view(buf, depth)?;
3165 ::core::result::Result::Ok(view)
3166 }
3167 #[doc(hidden)]
3175 pub fn _merge_into_view(
3176 &mut self,
3177 buf: &'a [u8],
3178 depth: u32,
3179 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3180 let _ = depth;
3181 #[allow(unused_variables)]
3182 let view = self;
3183 let mut cur: &'a [u8] = buf;
3184 while !cur.is_empty() {
3185 let before_tag = cur;
3186 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
3187 match tag.field_number() {
3188 1u32 => {
3189 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3190 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3191 field_number: 1u32,
3192 expected: 0u8,
3193 actual: tag.wire_type() as u8,
3194 });
3195 }
3196 view.max_results = Some(
3197 ::buffa::types::decode_int32(&mut cur)?,
3198 );
3199 }
3200 2u32 => {
3201 if tag.wire_type()
3202 != ::buffa::encoding::WireType::LengthDelimited
3203 {
3204 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3205 field_number: 2u32,
3206 expected: 2u8,
3207 actual: tag.wire_type() as u8,
3208 });
3209 }
3210 view.page_token = Some(
3211 ::buffa::types::borrow_str(&mut cur)?,
3212 );
3213 }
3214 _ => {
3215 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
3216 let span_len = before_tag.len() - cur.len();
3217 view.__buffa_unknown_fields
3218 .push_raw(&before_tag[..span_len]);
3219 }
3220 }
3221 }
3222 ::core::result::Result::Ok(())
3223 }
3224 }
3225 impl<'a> ::buffa::MessageView<'a> for ListProvidersRequestView<'a> {
3226 type Owned = super::super::ListProvidersRequest;
3227 fn decode_view(
3228 buf: &'a [u8],
3229 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3230 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
3231 }
3232 fn decode_view_with_limit(
3233 buf: &'a [u8],
3234 depth: u32,
3235 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3236 Self::_decode_depth(buf, depth)
3237 }
3238 fn to_owned_message(&self) -> super::super::ListProvidersRequest {
3239 self.to_owned_from_source(None)
3240 }
3241 #[allow(clippy::useless_conversion, clippy::needless_update)]
3242 fn to_owned_from_source(
3243 &self,
3244 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3245 ) -> super::super::ListProvidersRequest {
3246 #[allow(unused_imports)]
3247 use ::buffa::alloc::string::ToString as _;
3248 let _ = __buffa_src;
3249 super::super::ListProvidersRequest {
3250 max_results: self.max_results,
3251 page_token: self.page_token.map(|s| s.to_string()),
3252 __buffa_unknown_fields: self
3253 .__buffa_unknown_fields
3254 .to_owned()
3255 .unwrap_or_default()
3256 .into(),
3257 ..::core::default::Default::default()
3258 }
3259 }
3260 }
3261 impl<'a> ::buffa::ViewEncode<'a> for ListProvidersRequestView<'a> {
3262 #[allow(clippy::needless_borrow, clippy::let_and_return)]
3263 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3264 #[allow(unused_imports)]
3265 use ::buffa::Enumeration as _;
3266 let mut size = 0u32;
3267 if let Some(v) = self.max_results {
3268 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
3269 }
3270 if let Some(ref v) = self.page_token {
3271 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3272 }
3273 size += self.__buffa_unknown_fields.encoded_len() as u32;
3274 size
3275 }
3276 #[allow(clippy::needless_borrow)]
3277 fn write_to(
3278 &self,
3279 _cache: &mut ::buffa::SizeCache,
3280 buf: &mut impl ::buffa::bytes::BufMut,
3281 ) {
3282 #[allow(unused_imports)]
3283 use ::buffa::Enumeration as _;
3284 if let Some(v) = self.max_results {
3285 ::buffa::encoding::Tag::new(
3286 1u32,
3287 ::buffa::encoding::WireType::Varint,
3288 )
3289 .encode(buf);
3290 ::buffa::types::encode_int32(v, buf);
3291 }
3292 if let Some(ref v) = self.page_token {
3293 ::buffa::encoding::Tag::new(
3294 2u32,
3295 ::buffa::encoding::WireType::LengthDelimited,
3296 )
3297 .encode(buf);
3298 ::buffa::types::encode_string(v, buf);
3299 }
3300 self.__buffa_unknown_fields.write_to(buf);
3301 }
3302 }
3303 impl<'__a> ::serde::Serialize for ListProvidersRequestView<'__a> {
3315 fn serialize<__S: ::serde::Serializer>(
3316 &self,
3317 __s: __S,
3318 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3319 use ::serde::ser::SerializeMap as _;
3320 let mut __map = __s.serialize_map(::core::option::Option::None)?;
3321 if let ::core::option::Option::Some(__v) = self.max_results {
3322 struct _W(i32);
3323 impl ::serde::Serialize for _W {
3324 fn serialize<__S: ::serde::Serializer>(
3325 &self,
3326 __s: __S,
3327 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3328 ::buffa::json_helpers::int32::serialize(&self.0, __s)
3329 }
3330 }
3331 __map.serialize_entry("max_results", &_W(__v))?;
3332 }
3333 if let ::core::option::Option::Some(__v) = self.page_token {
3334 __map.serialize_entry("page_token", __v)?;
3335 }
3336 __map.end()
3337 }
3338 }
3339 impl<'a> ::buffa::MessageName for ListProvidersRequestView<'a> {
3340 const PACKAGE: &'static str = "unitycatalog.providers.v1";
3341 const NAME: &'static str = "ListProvidersRequest";
3342 const FULL_NAME: &'static str = "unitycatalog.providers.v1.ListProvidersRequest";
3343 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.ListProvidersRequest";
3344 }
3345 impl<'v> ::buffa::DefaultViewInstance for ListProvidersRequestView<'v> {
3346 fn default_view_instance<'a>() -> &'a Self
3347 where
3348 Self: 'a,
3349 {
3350 static VALUE: ::buffa::__private::OnceBox<
3351 ListProvidersRequestView<'static>,
3352 > = ::buffa::__private::OnceBox::new();
3353 VALUE
3354 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
3355 <ListProvidersRequestView<'static>>::default(),
3356 ))
3357 }
3358 }
3359 impl ::buffa::ViewReborrow for ListProvidersRequestView<'static> {
3360 type Reborrowed<'b> = ListProvidersRequestView<'b>;
3361 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
3362 this
3363 }
3364 }
3365 #[derive(Clone, Debug)]
3371 pub struct ListProvidersRequestOwnedView(
3372 ::buffa::OwnedView<ListProvidersRequestView<'static>>,
3373 );
3374 impl ListProvidersRequestOwnedView {
3375 pub fn decode(
3385 bytes: ::buffa::bytes::Bytes,
3386 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3387 ::core::result::Result::Ok(
3388 ListProvidersRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
3389 )
3390 }
3391 pub fn decode_with_options(
3399 bytes: ::buffa::bytes::Bytes,
3400 opts: &::buffa::DecodeOptions,
3401 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3402 ::core::result::Result::Ok(
3403 ListProvidersRequestOwnedView(
3404 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
3405 ),
3406 )
3407 }
3408 pub fn from_owned(
3415 msg: &super::super::ListProvidersRequest,
3416 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3417 ::core::result::Result::Ok(
3418 ListProvidersRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
3419 )
3420 }
3421 #[must_use]
3423 pub fn view(&self) -> &ListProvidersRequestView<'_> {
3424 self.0.reborrow()
3425 }
3426 #[must_use]
3428 pub fn to_owned_message(&self) -> super::super::ListProvidersRequest {
3429 self.0.to_owned_message()
3430 }
3431 #[must_use]
3433 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3434 self.0.bytes()
3435 }
3436 #[must_use]
3438 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3439 self.0.into_bytes()
3440 }
3441 #[must_use]
3445 pub fn max_results(&self) -> ::core::option::Option<i32> {
3446 self.0.reborrow().max_results
3447 }
3448 #[must_use]
3452 pub fn page_token(&self) -> ::core::option::Option<&'_ str> {
3453 self.0.reborrow().page_token
3454 }
3455 }
3456 impl ::core::convert::From<::buffa::OwnedView<ListProvidersRequestView<'static>>>
3457 for ListProvidersRequestOwnedView {
3458 fn from(
3459 inner: ::buffa::OwnedView<ListProvidersRequestView<'static>>,
3460 ) -> Self {
3461 ListProvidersRequestOwnedView(inner)
3462 }
3463 }
3464 impl ::core::convert::From<ListProvidersRequestOwnedView>
3465 for ::buffa::OwnedView<ListProvidersRequestView<'static>> {
3466 fn from(wrapper: ListProvidersRequestOwnedView) -> Self {
3467 wrapper.0
3468 }
3469 }
3470 impl ::core::convert::AsRef<
3471 ::buffa::OwnedView<ListProvidersRequestView<'static>>,
3472 > for ListProvidersRequestOwnedView {
3473 fn as_ref(&self) -> &::buffa::OwnedView<ListProvidersRequestView<'static>> {
3474 &self.0
3475 }
3476 }
3477 impl ::buffa::HasMessageView for super::super::ListProvidersRequest {
3478 type View<'a> = ListProvidersRequestView<'a>;
3479 type ViewHandle = ListProvidersRequestOwnedView;
3480 }
3481 impl ::serde::Serialize for ListProvidersRequestOwnedView {
3482 fn serialize<__S: ::serde::Serializer>(
3483 &self,
3484 __s: __S,
3485 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3486 ::serde::Serialize::serialize(&self.0, __s)
3487 }
3488 }
3489 #[derive(Clone, Debug, Default)]
3491 pub struct ListProvidersResponseView<'a> {
3492 pub providers: ::buffa::RepeatedView<
3496 'a,
3497 super::super::__buffa::view::ProviderView<'a>,
3498 >,
3499 pub next_page_token: ::core::option::Option<&'a str>,
3503 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
3504 }
3505 impl<'a> ListProvidersResponseView<'a> {
3506 #[doc(hidden)]
3514 pub fn _decode_depth(
3515 buf: &'a [u8],
3516 depth: u32,
3517 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3518 let mut view = Self::default();
3519 view._merge_into_view(buf, depth)?;
3520 ::core::result::Result::Ok(view)
3521 }
3522 #[doc(hidden)]
3530 pub fn _merge_into_view(
3531 &mut self,
3532 buf: &'a [u8],
3533 depth: u32,
3534 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3535 let _ = depth;
3536 #[allow(unused_variables)]
3537 let view = self;
3538 let mut cur: &'a [u8] = buf;
3539 while !cur.is_empty() {
3540 let before_tag = cur;
3541 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
3542 match tag.field_number() {
3543 2u32 => {
3544 if tag.wire_type()
3545 != ::buffa::encoding::WireType::LengthDelimited
3546 {
3547 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3548 field_number: 2u32,
3549 expected: 2u8,
3550 actual: tag.wire_type() as u8,
3551 });
3552 }
3553 view.next_page_token = Some(
3554 ::buffa::types::borrow_str(&mut cur)?,
3555 );
3556 }
3557 1u32 => {
3558 if tag.wire_type()
3559 != ::buffa::encoding::WireType::LengthDelimited
3560 {
3561 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3562 field_number: 1u32,
3563 expected: 2u8,
3564 actual: tag.wire_type() as u8,
3565 });
3566 }
3567 if depth == 0 {
3568 return Err(::buffa::DecodeError::RecursionLimitExceeded);
3569 }
3570 let sub = ::buffa::types::borrow_bytes(&mut cur)?;
3571 view.providers
3572 .push(
3573 super::super::__buffa::view::ProviderView::_decode_depth(
3574 sub,
3575 depth - 1,
3576 )?,
3577 );
3578 }
3579 _ => {
3580 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
3581 let span_len = before_tag.len() - cur.len();
3582 view.__buffa_unknown_fields
3583 .push_raw(&before_tag[..span_len]);
3584 }
3585 }
3586 }
3587 ::core::result::Result::Ok(())
3588 }
3589 }
3590 impl<'a> ::buffa::MessageView<'a> for ListProvidersResponseView<'a> {
3591 type Owned = super::super::ListProvidersResponse;
3592 fn decode_view(
3593 buf: &'a [u8],
3594 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3595 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
3596 }
3597 fn decode_view_with_limit(
3598 buf: &'a [u8],
3599 depth: u32,
3600 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3601 Self::_decode_depth(buf, depth)
3602 }
3603 fn to_owned_message(&self) -> super::super::ListProvidersResponse {
3604 self.to_owned_from_source(None)
3605 }
3606 #[allow(clippy::useless_conversion, clippy::needless_update)]
3607 fn to_owned_from_source(
3608 &self,
3609 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3610 ) -> super::super::ListProvidersResponse {
3611 #[allow(unused_imports)]
3612 use ::buffa::alloc::string::ToString as _;
3613 let _ = __buffa_src;
3614 super::super::ListProvidersResponse {
3615 providers: self
3616 .providers
3617 .iter()
3618 .map(|v| v.to_owned_from_source(__buffa_src))
3619 .collect(),
3620 next_page_token: self.next_page_token.map(|s| s.to_string()),
3621 __buffa_unknown_fields: self
3622 .__buffa_unknown_fields
3623 .to_owned()
3624 .unwrap_or_default()
3625 .into(),
3626 ..::core::default::Default::default()
3627 }
3628 }
3629 }
3630 impl<'a> ::buffa::ViewEncode<'a> for ListProvidersResponseView<'a> {
3631 #[allow(clippy::needless_borrow, clippy::let_and_return)]
3632 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
3633 #[allow(unused_imports)]
3634 use ::buffa::Enumeration as _;
3635 let mut size = 0u32;
3636 for v in &self.providers {
3637 let __slot = __cache.reserve();
3638 let inner_size = v.compute_size(__cache);
3639 __cache.set(__slot, inner_size);
3640 size
3641 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
3642 + inner_size;
3643 }
3644 if let Some(ref v) = self.next_page_token {
3645 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3646 }
3647 size += self.__buffa_unknown_fields.encoded_len() as u32;
3648 size
3649 }
3650 #[allow(clippy::needless_borrow)]
3651 fn write_to(
3652 &self,
3653 __cache: &mut ::buffa::SizeCache,
3654 buf: &mut impl ::buffa::bytes::BufMut,
3655 ) {
3656 #[allow(unused_imports)]
3657 use ::buffa::Enumeration as _;
3658 for v in &self.providers {
3659 ::buffa::encoding::Tag::new(
3660 1u32,
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(ref v) = self.next_page_token {
3668 ::buffa::encoding::Tag::new(
3669 2u32,
3670 ::buffa::encoding::WireType::LengthDelimited,
3671 )
3672 .encode(buf);
3673 ::buffa::types::encode_string(v, buf);
3674 }
3675 self.__buffa_unknown_fields.write_to(buf);
3676 }
3677 }
3678 impl<'__a> ::serde::Serialize for ListProvidersResponseView<'__a> {
3690 fn serialize<__S: ::serde::Serializer>(
3691 &self,
3692 __s: __S,
3693 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3694 use ::serde::ser::SerializeMap as _;
3695 let mut __map = __s.serialize_map(::core::option::Option::None)?;
3696 if !self.providers.is_empty() {
3697 __map.serialize_entry("providers", &*self.providers)?;
3698 }
3699 if let ::core::option::Option::Some(__v) = self.next_page_token {
3700 __map.serialize_entry("next_page_token", __v)?;
3701 }
3702 __map.end()
3703 }
3704 }
3705 impl<'a> ::buffa::MessageName for ListProvidersResponseView<'a> {
3706 const PACKAGE: &'static str = "unitycatalog.providers.v1";
3707 const NAME: &'static str = "ListProvidersResponse";
3708 const FULL_NAME: &'static str = "unitycatalog.providers.v1.ListProvidersResponse";
3709 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.ListProvidersResponse";
3710 }
3711 impl<'v> ::buffa::DefaultViewInstance for ListProvidersResponseView<'v> {
3712 fn default_view_instance<'a>() -> &'a Self
3713 where
3714 Self: 'a,
3715 {
3716 static VALUE: ::buffa::__private::OnceBox<
3717 ListProvidersResponseView<'static>,
3718 > = ::buffa::__private::OnceBox::new();
3719 VALUE
3720 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
3721 <ListProvidersResponseView<'static>>::default(),
3722 ))
3723 }
3724 }
3725 impl ::buffa::ViewReborrow for ListProvidersResponseView<'static> {
3726 type Reborrowed<'b> = ListProvidersResponseView<'b>;
3727 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
3728 this
3729 }
3730 }
3731 #[derive(Clone, Debug)]
3737 pub struct ListProvidersResponseOwnedView(
3738 ::buffa::OwnedView<ListProvidersResponseView<'static>>,
3739 );
3740 impl ListProvidersResponseOwnedView {
3741 pub fn decode(
3751 bytes: ::buffa::bytes::Bytes,
3752 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3753 ::core::result::Result::Ok(
3754 ListProvidersResponseOwnedView(::buffa::OwnedView::decode(bytes)?),
3755 )
3756 }
3757 pub fn decode_with_options(
3765 bytes: ::buffa::bytes::Bytes,
3766 opts: &::buffa::DecodeOptions,
3767 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3768 ::core::result::Result::Ok(
3769 ListProvidersResponseOwnedView(
3770 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
3771 ),
3772 )
3773 }
3774 pub fn from_owned(
3781 msg: &super::super::ListProvidersResponse,
3782 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3783 ::core::result::Result::Ok(
3784 ListProvidersResponseOwnedView(::buffa::OwnedView::from_owned(msg)?),
3785 )
3786 }
3787 #[must_use]
3789 pub fn view(&self) -> &ListProvidersResponseView<'_> {
3790 self.0.reborrow()
3791 }
3792 #[must_use]
3794 pub fn to_owned_message(&self) -> super::super::ListProvidersResponse {
3795 self.0.to_owned_message()
3796 }
3797 #[must_use]
3799 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3800 self.0.bytes()
3801 }
3802 #[must_use]
3804 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3805 self.0.into_bytes()
3806 }
3807 #[must_use]
3811 pub fn providers(
3812 &self,
3813 ) -> &::buffa::RepeatedView<
3814 '_,
3815 super::super::__buffa::view::ProviderView<'_>,
3816 > {
3817 &self.0.reborrow().providers
3818 }
3819 #[must_use]
3823 pub fn next_page_token(&self) -> ::core::option::Option<&'_ str> {
3824 self.0.reborrow().next_page_token
3825 }
3826 }
3827 impl ::core::convert::From<
3828 ::buffa::OwnedView<ListProvidersResponseView<'static>>,
3829 > for ListProvidersResponseOwnedView {
3830 fn from(
3831 inner: ::buffa::OwnedView<ListProvidersResponseView<'static>>,
3832 ) -> Self {
3833 ListProvidersResponseOwnedView(inner)
3834 }
3835 }
3836 impl ::core::convert::From<ListProvidersResponseOwnedView>
3837 for ::buffa::OwnedView<ListProvidersResponseView<'static>> {
3838 fn from(wrapper: ListProvidersResponseOwnedView) -> Self {
3839 wrapper.0
3840 }
3841 }
3842 impl ::core::convert::AsRef<
3843 ::buffa::OwnedView<ListProvidersResponseView<'static>>,
3844 > for ListProvidersResponseOwnedView {
3845 fn as_ref(&self) -> &::buffa::OwnedView<ListProvidersResponseView<'static>> {
3846 &self.0
3847 }
3848 }
3849 impl ::buffa::HasMessageView for super::super::ListProvidersResponse {
3850 type View<'a> = ListProvidersResponseView<'a>;
3851 type ViewHandle = ListProvidersResponseOwnedView;
3852 }
3853 impl ::serde::Serialize for ListProvidersResponseOwnedView {
3854 fn serialize<__S: ::serde::Serializer>(
3855 &self,
3856 __s: __S,
3857 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3858 ::serde::Serialize::serialize(&self.0, __s)
3859 }
3860 }
3861 #[derive(Clone, Debug, Default)]
3863 pub struct CreateProviderRequestView<'a> {
3864 pub name: &'a str,
3868 pub authentication_type: ::buffa::EnumValue<
3872 super::super::ProviderAuthenticationType,
3873 >,
3874 pub owner: ::core::option::Option<&'a str>,
3878 pub comment: ::core::option::Option<&'a str>,
3882 pub recipient_profile_str: ::core::option::Option<&'a str>,
3887 pub properties: ::buffa::MapView<'a, &'a str, &'a str>,
3891 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
3892 }
3893 impl<'a> CreateProviderRequestView<'a> {
3894 #[doc(hidden)]
3902 pub fn _decode_depth(
3903 buf: &'a [u8],
3904 depth: u32,
3905 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3906 let mut view = Self::default();
3907 view._merge_into_view(buf, depth)?;
3908 ::core::result::Result::Ok(view)
3909 }
3910 #[doc(hidden)]
3918 pub fn _merge_into_view(
3919 &mut self,
3920 buf: &'a [u8],
3921 depth: u32,
3922 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3923 let _ = depth;
3924 #[allow(unused_variables)]
3925 let view = self;
3926 let mut cur: &'a [u8] = buf;
3927 while !cur.is_empty() {
3928 let before_tag = cur;
3929 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
3930 match tag.field_number() {
3931 1u32 => {
3932 if tag.wire_type()
3933 != ::buffa::encoding::WireType::LengthDelimited
3934 {
3935 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3936 field_number: 1u32,
3937 expected: 2u8,
3938 actual: tag.wire_type() as u8,
3939 });
3940 }
3941 view.name = ::buffa::types::borrow_str(&mut cur)?;
3942 }
3943 2u32 => {
3944 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3945 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3946 field_number: 2u32,
3947 expected: 0u8,
3948 actual: tag.wire_type() as u8,
3949 });
3950 }
3951 view.authentication_type = ::buffa::EnumValue::from(
3952 ::buffa::types::decode_int32(&mut cur)?,
3953 );
3954 }
3955 3u32 => {
3956 if tag.wire_type()
3957 != ::buffa::encoding::WireType::LengthDelimited
3958 {
3959 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3960 field_number: 3u32,
3961 expected: 2u8,
3962 actual: tag.wire_type() as u8,
3963 });
3964 }
3965 view.owner = Some(::buffa::types::borrow_str(&mut cur)?);
3966 }
3967 4u32 => {
3968 if tag.wire_type()
3969 != ::buffa::encoding::WireType::LengthDelimited
3970 {
3971 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3972 field_number: 4u32,
3973 expected: 2u8,
3974 actual: tag.wire_type() as u8,
3975 });
3976 }
3977 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
3978 }
3979 5u32 => {
3980 if tag.wire_type()
3981 != ::buffa::encoding::WireType::LengthDelimited
3982 {
3983 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3984 field_number: 5u32,
3985 expected: 2u8,
3986 actual: tag.wire_type() as u8,
3987 });
3988 }
3989 view.recipient_profile_str = Some(
3990 ::buffa::types::borrow_str(&mut cur)?,
3991 );
3992 }
3993 6u32 => {
3994 if tag.wire_type()
3995 != ::buffa::encoding::WireType::LengthDelimited
3996 {
3997 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3998 field_number: 6u32,
3999 expected: 2u8,
4000 actual: tag.wire_type() as u8,
4001 });
4002 }
4003 let entry_bytes = ::buffa::types::borrow_bytes(&mut cur)?;
4004 let mut entry_cur: &'a [u8] = entry_bytes;
4005 let mut key = "";
4006 let mut val = "";
4007 while !entry_cur.is_empty() {
4008 let entry_tag = ::buffa::encoding::Tag::decode(
4009 &mut entry_cur,
4010 )?;
4011 match entry_tag.field_number() {
4012 1 => {
4013 if entry_tag.wire_type()
4014 != ::buffa::encoding::WireType::LengthDelimited
4015 {
4016 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4017 field_number: entry_tag.field_number(),
4018 expected: 2u8,
4019 actual: entry_tag.wire_type() as u8,
4020 });
4021 }
4022 key = ::buffa::types::borrow_str(&mut entry_cur)?;
4023 }
4024 2 => {
4025 if entry_tag.wire_type()
4026 != ::buffa::encoding::WireType::LengthDelimited
4027 {
4028 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4029 field_number: entry_tag.field_number(),
4030 expected: 2u8,
4031 actual: entry_tag.wire_type() as u8,
4032 });
4033 }
4034 val = ::buffa::types::borrow_str(&mut entry_cur)?;
4035 }
4036 _ => {
4037 ::buffa::encoding::skip_field_depth(
4038 entry_tag,
4039 &mut entry_cur,
4040 depth,
4041 )?;
4042 }
4043 }
4044 }
4045 view.properties.push(key, val);
4046 }
4047 _ => {
4048 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4049 let span_len = before_tag.len() - cur.len();
4050 view.__buffa_unknown_fields
4051 .push_raw(&before_tag[..span_len]);
4052 }
4053 }
4054 }
4055 ::core::result::Result::Ok(())
4056 }
4057 }
4058 impl<'a> ::buffa::MessageView<'a> for CreateProviderRequestView<'a> {
4059 type Owned = super::super::CreateProviderRequest;
4060 fn decode_view(
4061 buf: &'a [u8],
4062 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4063 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
4064 }
4065 fn decode_view_with_limit(
4066 buf: &'a [u8],
4067 depth: u32,
4068 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4069 Self::_decode_depth(buf, depth)
4070 }
4071 fn to_owned_message(&self) -> super::super::CreateProviderRequest {
4072 self.to_owned_from_source(None)
4073 }
4074 #[allow(clippy::useless_conversion, clippy::needless_update)]
4075 fn to_owned_from_source(
4076 &self,
4077 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4078 ) -> super::super::CreateProviderRequest {
4079 #[allow(unused_imports)]
4080 use ::buffa::alloc::string::ToString as _;
4081 let _ = __buffa_src;
4082 super::super::CreateProviderRequest {
4083 name: self.name.to_string(),
4084 authentication_type: self.authentication_type,
4085 owner: self.owner.map(|s| s.to_string()),
4086 comment: self.comment.map(|s| s.to_string()),
4087 recipient_profile_str: self
4088 .recipient_profile_str
4089 .map(|s| s.to_string()),
4090 properties: self
4091 .properties
4092 .iter()
4093 .map(|(k, v)| (k.to_string(), v.to_string()))
4094 .collect(),
4095 __buffa_unknown_fields: self
4096 .__buffa_unknown_fields
4097 .to_owned()
4098 .unwrap_or_default()
4099 .into(),
4100 ..::core::default::Default::default()
4101 }
4102 }
4103 }
4104 impl<'a> ::buffa::ViewEncode<'a> for CreateProviderRequestView<'a> {
4105 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4106 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
4107 #[allow(unused_imports)]
4108 use ::buffa::Enumeration as _;
4109 let mut size = 0u32;
4110 if !self.name.is_empty() {
4111 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
4112 }
4113 {
4114 let val = self.authentication_type.to_i32();
4115 if val != 0 {
4116 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
4117 }
4118 }
4119 if let Some(ref v) = self.owner {
4120 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4121 }
4122 if let Some(ref v) = self.comment {
4123 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4124 }
4125 if let Some(ref v) = self.recipient_profile_str {
4126 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4127 }
4128 #[allow(clippy::for_kv_map)]
4129 for (k, v) in &self.properties {
4130 let entry_size: u32 = 1u32
4131 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
4132 + ::buffa::types::string_encoded_len(v) as u32;
4133 size
4134 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
4135 + entry_size;
4136 }
4137 size += self.__buffa_unknown_fields.encoded_len() as u32;
4138 size
4139 }
4140 #[allow(clippy::needless_borrow)]
4141 fn write_to(
4142 &self,
4143 _cache: &mut ::buffa::SizeCache,
4144 buf: &mut impl ::buffa::bytes::BufMut,
4145 ) {
4146 #[allow(unused_imports)]
4147 use ::buffa::Enumeration as _;
4148 if !self.name.is_empty() {
4149 ::buffa::encoding::Tag::new(
4150 1u32,
4151 ::buffa::encoding::WireType::LengthDelimited,
4152 )
4153 .encode(buf);
4154 ::buffa::types::encode_string(&self.name, buf);
4155 }
4156 {
4157 let val = self.authentication_type.to_i32();
4158 if val != 0 {
4159 ::buffa::encoding::Tag::new(
4160 2u32,
4161 ::buffa::encoding::WireType::Varint,
4162 )
4163 .encode(buf);
4164 ::buffa::types::encode_int32(val, buf);
4165 }
4166 }
4167 if let Some(ref v) = self.owner {
4168 ::buffa::encoding::Tag::new(
4169 3u32,
4170 ::buffa::encoding::WireType::LengthDelimited,
4171 )
4172 .encode(buf);
4173 ::buffa::types::encode_string(v, buf);
4174 }
4175 if let Some(ref v) = self.comment {
4176 ::buffa::encoding::Tag::new(
4177 4u32,
4178 ::buffa::encoding::WireType::LengthDelimited,
4179 )
4180 .encode(buf);
4181 ::buffa::types::encode_string(v, buf);
4182 }
4183 if let Some(ref v) = self.recipient_profile_str {
4184 ::buffa::encoding::Tag::new(
4185 5u32,
4186 ::buffa::encoding::WireType::LengthDelimited,
4187 )
4188 .encode(buf);
4189 ::buffa::types::encode_string(v, buf);
4190 }
4191 for (k, v) in &self.properties {
4192 let entry_size: u32 = 1u32
4193 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
4194 + ::buffa::types::string_encoded_len(v) as u32;
4195 ::buffa::encoding::Tag::new(
4196 6u32,
4197 ::buffa::encoding::WireType::LengthDelimited,
4198 )
4199 .encode(buf);
4200 ::buffa::encoding::encode_varint(entry_size as u64, buf);
4201 ::buffa::encoding::Tag::new(
4202 1u32,
4203 ::buffa::encoding::WireType::LengthDelimited,
4204 )
4205 .encode(buf);
4206 ::buffa::types::encode_string(k, buf);
4207 ::buffa::encoding::Tag::new(
4208 2u32,
4209 ::buffa::encoding::WireType::LengthDelimited,
4210 )
4211 .encode(buf);
4212 ::buffa::types::encode_string(v, buf);
4213 }
4214 self.__buffa_unknown_fields.write_to(buf);
4215 }
4216 }
4217 impl<'__a> ::serde::Serialize for CreateProviderRequestView<'__a> {
4229 fn serialize<__S: ::serde::Serializer>(
4230 &self,
4231 __s: __S,
4232 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4233 use ::serde::ser::SerializeMap as _;
4234 let mut __map = __s.serialize_map(::core::option::Option::None)?;
4235 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
4236 __map.serialize_entry("name", self.name)?;
4237 }
4238 if !::buffa::json_helpers::skip_if::is_default_enum_value(
4239 &self.authentication_type,
4240 ) {
4241 __map
4242 .serialize_entry(
4243 "authenticationType",
4244 &self.authentication_type,
4245 )?;
4246 }
4247 if let ::core::option::Option::Some(__v) = self.owner {
4248 __map.serialize_entry("owner", __v)?;
4249 }
4250 if let ::core::option::Option::Some(__v) = self.comment {
4251 __map.serialize_entry("comment", __v)?;
4252 }
4253 if let ::core::option::Option::Some(__v) = self.recipient_profile_str {
4254 __map.serialize_entry("recipient_profile_str", __v)?;
4255 }
4256 if !self.properties.is_empty() {
4257 struct _WM<'__a, '__x>(
4258 &'__x ::buffa::MapView<'__x, &'__a str, &'__a str>,
4259 );
4260 impl<'__a> ::serde::Serialize for _WM<'__a, '_> {
4261 fn serialize<__S: ::serde::Serializer>(
4262 &self,
4263 __s: __S,
4264 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4265 use ::serde::ser::SerializeMap as _;
4266 let mut __m = __s
4267 .serialize_map(::core::option::Option::Some(self.0.len()))?;
4268 for (k, v) in self.0.iter_unique() {
4269 __m.serialize_entry(k, v)?;
4270 }
4271 __m.end()
4272 }
4273 }
4274 __map.serialize_entry("properties", &_WM(&self.properties))?;
4275 }
4276 __map.end()
4277 }
4278 }
4279 impl<'a> ::buffa::MessageName for CreateProviderRequestView<'a> {
4280 const PACKAGE: &'static str = "unitycatalog.providers.v1";
4281 const NAME: &'static str = "CreateProviderRequest";
4282 const FULL_NAME: &'static str = "unitycatalog.providers.v1.CreateProviderRequest";
4283 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.CreateProviderRequest";
4284 }
4285 impl<'v> ::buffa::DefaultViewInstance for CreateProviderRequestView<'v> {
4286 fn default_view_instance<'a>() -> &'a Self
4287 where
4288 Self: 'a,
4289 {
4290 static VALUE: ::buffa::__private::OnceBox<
4291 CreateProviderRequestView<'static>,
4292 > = ::buffa::__private::OnceBox::new();
4293 VALUE
4294 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
4295 <CreateProviderRequestView<'static>>::default(),
4296 ))
4297 }
4298 }
4299 impl ::buffa::ViewReborrow for CreateProviderRequestView<'static> {
4300 type Reborrowed<'b> = CreateProviderRequestView<'b>;
4301 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
4302 this
4303 }
4304 }
4305 #[derive(Clone, Debug)]
4311 pub struct CreateProviderRequestOwnedView(
4312 ::buffa::OwnedView<CreateProviderRequestView<'static>>,
4313 );
4314 impl CreateProviderRequestOwnedView {
4315 pub fn decode(
4325 bytes: ::buffa::bytes::Bytes,
4326 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4327 ::core::result::Result::Ok(
4328 CreateProviderRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
4329 )
4330 }
4331 pub fn decode_with_options(
4339 bytes: ::buffa::bytes::Bytes,
4340 opts: &::buffa::DecodeOptions,
4341 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4342 ::core::result::Result::Ok(
4343 CreateProviderRequestOwnedView(
4344 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4345 ),
4346 )
4347 }
4348 pub fn from_owned(
4355 msg: &super::super::CreateProviderRequest,
4356 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4357 ::core::result::Result::Ok(
4358 CreateProviderRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
4359 )
4360 }
4361 #[must_use]
4363 pub fn view(&self) -> &CreateProviderRequestView<'_> {
4364 self.0.reborrow()
4365 }
4366 #[must_use]
4368 pub fn to_owned_message(&self) -> super::super::CreateProviderRequest {
4369 self.0.to_owned_message()
4370 }
4371 #[must_use]
4373 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4374 self.0.bytes()
4375 }
4376 #[must_use]
4378 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4379 self.0.into_bytes()
4380 }
4381 #[must_use]
4385 pub fn name(&self) -> &'_ str {
4386 self.0.reborrow().name
4387 }
4388 #[must_use]
4392 pub fn authentication_type(
4393 &self,
4394 ) -> ::buffa::EnumValue<super::super::ProviderAuthenticationType> {
4395 self.0.reborrow().authentication_type
4396 }
4397 #[must_use]
4401 pub fn owner(&self) -> ::core::option::Option<&'_ str> {
4402 self.0.reborrow().owner
4403 }
4404 #[must_use]
4408 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
4409 self.0.reborrow().comment
4410 }
4411 #[must_use]
4416 pub fn recipient_profile_str(&self) -> ::core::option::Option<&'_ str> {
4417 self.0.reborrow().recipient_profile_str
4418 }
4419 #[must_use]
4423 pub fn properties(&self) -> &::buffa::MapView<'_, &'_ str, &'_ str> {
4424 &self.0.reborrow().properties
4425 }
4426 }
4427 impl ::core::convert::From<
4428 ::buffa::OwnedView<CreateProviderRequestView<'static>>,
4429 > for CreateProviderRequestOwnedView {
4430 fn from(
4431 inner: ::buffa::OwnedView<CreateProviderRequestView<'static>>,
4432 ) -> Self {
4433 CreateProviderRequestOwnedView(inner)
4434 }
4435 }
4436 impl ::core::convert::From<CreateProviderRequestOwnedView>
4437 for ::buffa::OwnedView<CreateProviderRequestView<'static>> {
4438 fn from(wrapper: CreateProviderRequestOwnedView) -> Self {
4439 wrapper.0
4440 }
4441 }
4442 impl ::core::convert::AsRef<
4443 ::buffa::OwnedView<CreateProviderRequestView<'static>>,
4444 > for CreateProviderRequestOwnedView {
4445 fn as_ref(&self) -> &::buffa::OwnedView<CreateProviderRequestView<'static>> {
4446 &self.0
4447 }
4448 }
4449 impl ::buffa::HasMessageView for super::super::CreateProviderRequest {
4450 type View<'a> = CreateProviderRequestView<'a>;
4451 type ViewHandle = CreateProviderRequestOwnedView;
4452 }
4453 impl ::serde::Serialize for CreateProviderRequestOwnedView {
4454 fn serialize<__S: ::serde::Serializer>(
4455 &self,
4456 __s: __S,
4457 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4458 ::serde::Serialize::serialize(&self.0, __s)
4459 }
4460 }
4461 #[derive(Clone, Debug, Default)]
4463 pub struct GetProviderRequestView<'a> {
4464 pub name: &'a str,
4468 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4469 }
4470 impl<'a> GetProviderRequestView<'a> {
4471 #[doc(hidden)]
4479 pub fn _decode_depth(
4480 buf: &'a [u8],
4481 depth: u32,
4482 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4483 let mut view = Self::default();
4484 view._merge_into_view(buf, depth)?;
4485 ::core::result::Result::Ok(view)
4486 }
4487 #[doc(hidden)]
4495 pub fn _merge_into_view(
4496 &mut self,
4497 buf: &'a [u8],
4498 depth: u32,
4499 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4500 let _ = depth;
4501 #[allow(unused_variables)]
4502 let view = self;
4503 let mut cur: &'a [u8] = buf;
4504 while !cur.is_empty() {
4505 let before_tag = cur;
4506 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
4507 match tag.field_number() {
4508 1u32 => {
4509 if tag.wire_type()
4510 != ::buffa::encoding::WireType::LengthDelimited
4511 {
4512 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4513 field_number: 1u32,
4514 expected: 2u8,
4515 actual: tag.wire_type() as u8,
4516 });
4517 }
4518 view.name = ::buffa::types::borrow_str(&mut cur)?;
4519 }
4520 _ => {
4521 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4522 let span_len = before_tag.len() - cur.len();
4523 view.__buffa_unknown_fields
4524 .push_raw(&before_tag[..span_len]);
4525 }
4526 }
4527 }
4528 ::core::result::Result::Ok(())
4529 }
4530 }
4531 impl<'a> ::buffa::MessageView<'a> for GetProviderRequestView<'a> {
4532 type Owned = super::super::GetProviderRequest;
4533 fn decode_view(
4534 buf: &'a [u8],
4535 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4536 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
4537 }
4538 fn decode_view_with_limit(
4539 buf: &'a [u8],
4540 depth: u32,
4541 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4542 Self::_decode_depth(buf, depth)
4543 }
4544 fn to_owned_message(&self) -> super::super::GetProviderRequest {
4545 self.to_owned_from_source(None)
4546 }
4547 #[allow(clippy::useless_conversion, clippy::needless_update)]
4548 fn to_owned_from_source(
4549 &self,
4550 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4551 ) -> super::super::GetProviderRequest {
4552 #[allow(unused_imports)]
4553 use ::buffa::alloc::string::ToString as _;
4554 let _ = __buffa_src;
4555 super::super::GetProviderRequest {
4556 name: self.name.to_string(),
4557 __buffa_unknown_fields: self
4558 .__buffa_unknown_fields
4559 .to_owned()
4560 .unwrap_or_default()
4561 .into(),
4562 ..::core::default::Default::default()
4563 }
4564 }
4565 }
4566 impl<'a> ::buffa::ViewEncode<'a> for GetProviderRequestView<'a> {
4567 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4568 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
4569 #[allow(unused_imports)]
4570 use ::buffa::Enumeration as _;
4571 let mut size = 0u32;
4572 if !self.name.is_empty() {
4573 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
4574 }
4575 size += self.__buffa_unknown_fields.encoded_len() as u32;
4576 size
4577 }
4578 #[allow(clippy::needless_borrow)]
4579 fn write_to(
4580 &self,
4581 _cache: &mut ::buffa::SizeCache,
4582 buf: &mut impl ::buffa::bytes::BufMut,
4583 ) {
4584 #[allow(unused_imports)]
4585 use ::buffa::Enumeration as _;
4586 if !self.name.is_empty() {
4587 ::buffa::encoding::Tag::new(
4588 1u32,
4589 ::buffa::encoding::WireType::LengthDelimited,
4590 )
4591 .encode(buf);
4592 ::buffa::types::encode_string(&self.name, buf);
4593 }
4594 self.__buffa_unknown_fields.write_to(buf);
4595 }
4596 }
4597 impl<'__a> ::serde::Serialize for GetProviderRequestView<'__a> {
4609 fn serialize<__S: ::serde::Serializer>(
4610 &self,
4611 __s: __S,
4612 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4613 use ::serde::ser::SerializeMap as _;
4614 let mut __map = __s.serialize_map(::core::option::Option::None)?;
4615 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
4616 __map.serialize_entry("name", self.name)?;
4617 }
4618 __map.end()
4619 }
4620 }
4621 impl<'a> ::buffa::MessageName for GetProviderRequestView<'a> {
4622 const PACKAGE: &'static str = "unitycatalog.providers.v1";
4623 const NAME: &'static str = "GetProviderRequest";
4624 const FULL_NAME: &'static str = "unitycatalog.providers.v1.GetProviderRequest";
4625 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.GetProviderRequest";
4626 }
4627 impl<'v> ::buffa::DefaultViewInstance for GetProviderRequestView<'v> {
4628 fn default_view_instance<'a>() -> &'a Self
4629 where
4630 Self: 'a,
4631 {
4632 static VALUE: ::buffa::__private::OnceBox<
4633 GetProviderRequestView<'static>,
4634 > = ::buffa::__private::OnceBox::new();
4635 VALUE
4636 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
4637 <GetProviderRequestView<'static>>::default(),
4638 ))
4639 }
4640 }
4641 impl ::buffa::ViewReborrow for GetProviderRequestView<'static> {
4642 type Reborrowed<'b> = GetProviderRequestView<'b>;
4643 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
4644 this
4645 }
4646 }
4647 #[derive(Clone, Debug)]
4653 pub struct GetProviderRequestOwnedView(
4654 ::buffa::OwnedView<GetProviderRequestView<'static>>,
4655 );
4656 impl GetProviderRequestOwnedView {
4657 pub fn decode(
4667 bytes: ::buffa::bytes::Bytes,
4668 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4669 ::core::result::Result::Ok(
4670 GetProviderRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
4671 )
4672 }
4673 pub fn decode_with_options(
4681 bytes: ::buffa::bytes::Bytes,
4682 opts: &::buffa::DecodeOptions,
4683 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4684 ::core::result::Result::Ok(
4685 GetProviderRequestOwnedView(
4686 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4687 ),
4688 )
4689 }
4690 pub fn from_owned(
4697 msg: &super::super::GetProviderRequest,
4698 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4699 ::core::result::Result::Ok(
4700 GetProviderRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
4701 )
4702 }
4703 #[must_use]
4705 pub fn view(&self) -> &GetProviderRequestView<'_> {
4706 self.0.reborrow()
4707 }
4708 #[must_use]
4710 pub fn to_owned_message(&self) -> super::super::GetProviderRequest {
4711 self.0.to_owned_message()
4712 }
4713 #[must_use]
4715 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4716 self.0.bytes()
4717 }
4718 #[must_use]
4720 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4721 self.0.into_bytes()
4722 }
4723 #[must_use]
4727 pub fn name(&self) -> &'_ str {
4728 self.0.reborrow().name
4729 }
4730 }
4731 impl ::core::convert::From<::buffa::OwnedView<GetProviderRequestView<'static>>>
4732 for GetProviderRequestOwnedView {
4733 fn from(inner: ::buffa::OwnedView<GetProviderRequestView<'static>>) -> Self {
4734 GetProviderRequestOwnedView(inner)
4735 }
4736 }
4737 impl ::core::convert::From<GetProviderRequestOwnedView>
4738 for ::buffa::OwnedView<GetProviderRequestView<'static>> {
4739 fn from(wrapper: GetProviderRequestOwnedView) -> Self {
4740 wrapper.0
4741 }
4742 }
4743 impl ::core::convert::AsRef<::buffa::OwnedView<GetProviderRequestView<'static>>>
4744 for GetProviderRequestOwnedView {
4745 fn as_ref(&self) -> &::buffa::OwnedView<GetProviderRequestView<'static>> {
4746 &self.0
4747 }
4748 }
4749 impl ::buffa::HasMessageView for super::super::GetProviderRequest {
4750 type View<'a> = GetProviderRequestView<'a>;
4751 type ViewHandle = GetProviderRequestOwnedView;
4752 }
4753 impl ::serde::Serialize for GetProviderRequestOwnedView {
4754 fn serialize<__S: ::serde::Serializer>(
4755 &self,
4756 __s: __S,
4757 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4758 ::serde::Serialize::serialize(&self.0, __s)
4759 }
4760 }
4761 #[derive(Clone, Debug, Default)]
4763 pub struct UpdateProviderRequestView<'a> {
4764 pub name: &'a str,
4768 pub new_name: ::core::option::Option<&'a str>,
4772 pub owner: ::core::option::Option<&'a str>,
4776 pub comment: ::core::option::Option<&'a str>,
4780 pub recipient_profile_str: ::core::option::Option<&'a str>,
4785 pub properties: ::buffa::MapView<'a, &'a str, &'a str>,
4792 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4793 }
4794 impl<'a> UpdateProviderRequestView<'a> {
4795 #[doc(hidden)]
4803 pub fn _decode_depth(
4804 buf: &'a [u8],
4805 depth: u32,
4806 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4807 let mut view = Self::default();
4808 view._merge_into_view(buf, depth)?;
4809 ::core::result::Result::Ok(view)
4810 }
4811 #[doc(hidden)]
4819 pub fn _merge_into_view(
4820 &mut self,
4821 buf: &'a [u8],
4822 depth: u32,
4823 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4824 let _ = depth;
4825 #[allow(unused_variables)]
4826 let view = self;
4827 let mut cur: &'a [u8] = buf;
4828 while !cur.is_empty() {
4829 let before_tag = cur;
4830 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
4831 match tag.field_number() {
4832 1u32 => {
4833 if tag.wire_type()
4834 != ::buffa::encoding::WireType::LengthDelimited
4835 {
4836 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4837 field_number: 1u32,
4838 expected: 2u8,
4839 actual: tag.wire_type() as u8,
4840 });
4841 }
4842 view.name = ::buffa::types::borrow_str(&mut cur)?;
4843 }
4844 2u32 => {
4845 if tag.wire_type()
4846 != ::buffa::encoding::WireType::LengthDelimited
4847 {
4848 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4849 field_number: 2u32,
4850 expected: 2u8,
4851 actual: tag.wire_type() as u8,
4852 });
4853 }
4854 view.new_name = Some(::buffa::types::borrow_str(&mut cur)?);
4855 }
4856 3u32 => {
4857 if tag.wire_type()
4858 != ::buffa::encoding::WireType::LengthDelimited
4859 {
4860 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4861 field_number: 3u32,
4862 expected: 2u8,
4863 actual: tag.wire_type() as u8,
4864 });
4865 }
4866 view.owner = Some(::buffa::types::borrow_str(&mut cur)?);
4867 }
4868 4u32 => {
4869 if tag.wire_type()
4870 != ::buffa::encoding::WireType::LengthDelimited
4871 {
4872 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4873 field_number: 4u32,
4874 expected: 2u8,
4875 actual: tag.wire_type() as u8,
4876 });
4877 }
4878 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
4879 }
4880 5u32 => {
4881 if tag.wire_type()
4882 != ::buffa::encoding::WireType::LengthDelimited
4883 {
4884 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4885 field_number: 5u32,
4886 expected: 2u8,
4887 actual: tag.wire_type() as u8,
4888 });
4889 }
4890 view.recipient_profile_str = Some(
4891 ::buffa::types::borrow_str(&mut cur)?,
4892 );
4893 }
4894 6u32 => {
4895 if tag.wire_type()
4896 != ::buffa::encoding::WireType::LengthDelimited
4897 {
4898 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4899 field_number: 6u32,
4900 expected: 2u8,
4901 actual: tag.wire_type() as u8,
4902 });
4903 }
4904 let entry_bytes = ::buffa::types::borrow_bytes(&mut cur)?;
4905 let mut entry_cur: &'a [u8] = entry_bytes;
4906 let mut key = "";
4907 let mut val = "";
4908 while !entry_cur.is_empty() {
4909 let entry_tag = ::buffa::encoding::Tag::decode(
4910 &mut entry_cur,
4911 )?;
4912 match entry_tag.field_number() {
4913 1 => {
4914 if entry_tag.wire_type()
4915 != ::buffa::encoding::WireType::LengthDelimited
4916 {
4917 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4918 field_number: entry_tag.field_number(),
4919 expected: 2u8,
4920 actual: entry_tag.wire_type() as u8,
4921 });
4922 }
4923 key = ::buffa::types::borrow_str(&mut entry_cur)?;
4924 }
4925 2 => {
4926 if entry_tag.wire_type()
4927 != ::buffa::encoding::WireType::LengthDelimited
4928 {
4929 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4930 field_number: entry_tag.field_number(),
4931 expected: 2u8,
4932 actual: entry_tag.wire_type() as u8,
4933 });
4934 }
4935 val = ::buffa::types::borrow_str(&mut entry_cur)?;
4936 }
4937 _ => {
4938 ::buffa::encoding::skip_field_depth(
4939 entry_tag,
4940 &mut entry_cur,
4941 depth,
4942 )?;
4943 }
4944 }
4945 }
4946 view.properties.push(key, val);
4947 }
4948 _ => {
4949 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4950 let span_len = before_tag.len() - cur.len();
4951 view.__buffa_unknown_fields
4952 .push_raw(&before_tag[..span_len]);
4953 }
4954 }
4955 }
4956 ::core::result::Result::Ok(())
4957 }
4958 }
4959 impl<'a> ::buffa::MessageView<'a> for UpdateProviderRequestView<'a> {
4960 type Owned = super::super::UpdateProviderRequest;
4961 fn decode_view(
4962 buf: &'a [u8],
4963 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4964 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
4965 }
4966 fn decode_view_with_limit(
4967 buf: &'a [u8],
4968 depth: u32,
4969 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4970 Self::_decode_depth(buf, depth)
4971 }
4972 fn to_owned_message(&self) -> super::super::UpdateProviderRequest {
4973 self.to_owned_from_source(None)
4974 }
4975 #[allow(clippy::useless_conversion, clippy::needless_update)]
4976 fn to_owned_from_source(
4977 &self,
4978 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4979 ) -> super::super::UpdateProviderRequest {
4980 #[allow(unused_imports)]
4981 use ::buffa::alloc::string::ToString as _;
4982 let _ = __buffa_src;
4983 super::super::UpdateProviderRequest {
4984 name: self.name.to_string(),
4985 new_name: self.new_name.map(|s| s.to_string()),
4986 owner: self.owner.map(|s| s.to_string()),
4987 comment: self.comment.map(|s| s.to_string()),
4988 recipient_profile_str: self
4989 .recipient_profile_str
4990 .map(|s| s.to_string()),
4991 properties: self
4992 .properties
4993 .iter()
4994 .map(|(k, v)| (k.to_string(), v.to_string()))
4995 .collect(),
4996 __buffa_unknown_fields: self
4997 .__buffa_unknown_fields
4998 .to_owned()
4999 .unwrap_or_default()
5000 .into(),
5001 ..::core::default::Default::default()
5002 }
5003 }
5004 }
5005 impl<'a> ::buffa::ViewEncode<'a> for UpdateProviderRequestView<'a> {
5006 #[allow(clippy::needless_borrow, clippy::let_and_return)]
5007 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5008 #[allow(unused_imports)]
5009 use ::buffa::Enumeration as _;
5010 let mut size = 0u32;
5011 if !self.name.is_empty() {
5012 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
5013 }
5014 if let Some(ref v) = self.new_name {
5015 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5016 }
5017 if let Some(ref v) = self.owner {
5018 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5019 }
5020 if let Some(ref v) = self.comment {
5021 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5022 }
5023 if let Some(ref v) = self.recipient_profile_str {
5024 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5025 }
5026 #[allow(clippy::for_kv_map)]
5027 for (k, v) in &self.properties {
5028 let entry_size: u32 = 1u32
5029 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
5030 + ::buffa::types::string_encoded_len(v) as u32;
5031 size
5032 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
5033 + entry_size;
5034 }
5035 size += self.__buffa_unknown_fields.encoded_len() as u32;
5036 size
5037 }
5038 #[allow(clippy::needless_borrow)]
5039 fn write_to(
5040 &self,
5041 _cache: &mut ::buffa::SizeCache,
5042 buf: &mut impl ::buffa::bytes::BufMut,
5043 ) {
5044 #[allow(unused_imports)]
5045 use ::buffa::Enumeration as _;
5046 if !self.name.is_empty() {
5047 ::buffa::encoding::Tag::new(
5048 1u32,
5049 ::buffa::encoding::WireType::LengthDelimited,
5050 )
5051 .encode(buf);
5052 ::buffa::types::encode_string(&self.name, buf);
5053 }
5054 if let Some(ref v) = self.new_name {
5055 ::buffa::encoding::Tag::new(
5056 2u32,
5057 ::buffa::encoding::WireType::LengthDelimited,
5058 )
5059 .encode(buf);
5060 ::buffa::types::encode_string(v, buf);
5061 }
5062 if let Some(ref v) = self.owner {
5063 ::buffa::encoding::Tag::new(
5064 3u32,
5065 ::buffa::encoding::WireType::LengthDelimited,
5066 )
5067 .encode(buf);
5068 ::buffa::types::encode_string(v, buf);
5069 }
5070 if let Some(ref v) = self.comment {
5071 ::buffa::encoding::Tag::new(
5072 4u32,
5073 ::buffa::encoding::WireType::LengthDelimited,
5074 )
5075 .encode(buf);
5076 ::buffa::types::encode_string(v, buf);
5077 }
5078 if let Some(ref v) = self.recipient_profile_str {
5079 ::buffa::encoding::Tag::new(
5080 5u32,
5081 ::buffa::encoding::WireType::LengthDelimited,
5082 )
5083 .encode(buf);
5084 ::buffa::types::encode_string(v, buf);
5085 }
5086 for (k, v) in &self.properties {
5087 let entry_size: u32 = 1u32
5088 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
5089 + ::buffa::types::string_encoded_len(v) as u32;
5090 ::buffa::encoding::Tag::new(
5091 6u32,
5092 ::buffa::encoding::WireType::LengthDelimited,
5093 )
5094 .encode(buf);
5095 ::buffa::encoding::encode_varint(entry_size as u64, buf);
5096 ::buffa::encoding::Tag::new(
5097 1u32,
5098 ::buffa::encoding::WireType::LengthDelimited,
5099 )
5100 .encode(buf);
5101 ::buffa::types::encode_string(k, buf);
5102 ::buffa::encoding::Tag::new(
5103 2u32,
5104 ::buffa::encoding::WireType::LengthDelimited,
5105 )
5106 .encode(buf);
5107 ::buffa::types::encode_string(v, buf);
5108 }
5109 self.__buffa_unknown_fields.write_to(buf);
5110 }
5111 }
5112 impl<'__a> ::serde::Serialize for UpdateProviderRequestView<'__a> {
5124 fn serialize<__S: ::serde::Serializer>(
5125 &self,
5126 __s: __S,
5127 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5128 use ::serde::ser::SerializeMap as _;
5129 let mut __map = __s.serialize_map(::core::option::Option::None)?;
5130 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
5131 __map.serialize_entry("name", self.name)?;
5132 }
5133 if let ::core::option::Option::Some(__v) = self.new_name {
5134 __map.serialize_entry("new_name", __v)?;
5135 }
5136 if let ::core::option::Option::Some(__v) = self.owner {
5137 __map.serialize_entry("owner", __v)?;
5138 }
5139 if let ::core::option::Option::Some(__v) = self.comment {
5140 __map.serialize_entry("comment", __v)?;
5141 }
5142 if let ::core::option::Option::Some(__v) = self.recipient_profile_str {
5143 __map.serialize_entry("recipient_profile_str", __v)?;
5144 }
5145 if !self.properties.is_empty() {
5146 struct _WM<'__a, '__x>(
5147 &'__x ::buffa::MapView<'__x, &'__a str, &'__a str>,
5148 );
5149 impl<'__a> ::serde::Serialize for _WM<'__a, '_> {
5150 fn serialize<__S: ::serde::Serializer>(
5151 &self,
5152 __s: __S,
5153 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5154 use ::serde::ser::SerializeMap as _;
5155 let mut __m = __s
5156 .serialize_map(::core::option::Option::Some(self.0.len()))?;
5157 for (k, v) in self.0.iter_unique() {
5158 __m.serialize_entry(k, v)?;
5159 }
5160 __m.end()
5161 }
5162 }
5163 __map.serialize_entry("properties", &_WM(&self.properties))?;
5164 }
5165 __map.end()
5166 }
5167 }
5168 impl<'a> ::buffa::MessageName for UpdateProviderRequestView<'a> {
5169 const PACKAGE: &'static str = "unitycatalog.providers.v1";
5170 const NAME: &'static str = "UpdateProviderRequest";
5171 const FULL_NAME: &'static str = "unitycatalog.providers.v1.UpdateProviderRequest";
5172 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.UpdateProviderRequest";
5173 }
5174 impl<'v> ::buffa::DefaultViewInstance for UpdateProviderRequestView<'v> {
5175 fn default_view_instance<'a>() -> &'a Self
5176 where
5177 Self: 'a,
5178 {
5179 static VALUE: ::buffa::__private::OnceBox<
5180 UpdateProviderRequestView<'static>,
5181 > = ::buffa::__private::OnceBox::new();
5182 VALUE
5183 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
5184 <UpdateProviderRequestView<'static>>::default(),
5185 ))
5186 }
5187 }
5188 impl ::buffa::ViewReborrow for UpdateProviderRequestView<'static> {
5189 type Reborrowed<'b> = UpdateProviderRequestView<'b>;
5190 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
5191 this
5192 }
5193 }
5194 #[derive(Clone, Debug)]
5200 pub struct UpdateProviderRequestOwnedView(
5201 ::buffa::OwnedView<UpdateProviderRequestView<'static>>,
5202 );
5203 impl UpdateProviderRequestOwnedView {
5204 pub fn decode(
5214 bytes: ::buffa::bytes::Bytes,
5215 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5216 ::core::result::Result::Ok(
5217 UpdateProviderRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
5218 )
5219 }
5220 pub fn decode_with_options(
5228 bytes: ::buffa::bytes::Bytes,
5229 opts: &::buffa::DecodeOptions,
5230 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5231 ::core::result::Result::Ok(
5232 UpdateProviderRequestOwnedView(
5233 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5234 ),
5235 )
5236 }
5237 pub fn from_owned(
5244 msg: &super::super::UpdateProviderRequest,
5245 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5246 ::core::result::Result::Ok(
5247 UpdateProviderRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
5248 )
5249 }
5250 #[must_use]
5252 pub fn view(&self) -> &UpdateProviderRequestView<'_> {
5253 self.0.reborrow()
5254 }
5255 #[must_use]
5257 pub fn to_owned_message(&self) -> super::super::UpdateProviderRequest {
5258 self.0.to_owned_message()
5259 }
5260 #[must_use]
5262 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5263 self.0.bytes()
5264 }
5265 #[must_use]
5267 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5268 self.0.into_bytes()
5269 }
5270 #[must_use]
5274 pub fn name(&self) -> &'_ str {
5275 self.0.reborrow().name
5276 }
5277 #[must_use]
5281 pub fn new_name(&self) -> ::core::option::Option<&'_ str> {
5282 self.0.reborrow().new_name
5283 }
5284 #[must_use]
5288 pub fn owner(&self) -> ::core::option::Option<&'_ str> {
5289 self.0.reborrow().owner
5290 }
5291 #[must_use]
5295 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
5296 self.0.reborrow().comment
5297 }
5298 #[must_use]
5303 pub fn recipient_profile_str(&self) -> ::core::option::Option<&'_ str> {
5304 self.0.reborrow().recipient_profile_str
5305 }
5306 #[must_use]
5313 pub fn properties(&self) -> &::buffa::MapView<'_, &'_ str, &'_ str> {
5314 &self.0.reborrow().properties
5315 }
5316 }
5317 impl ::core::convert::From<
5318 ::buffa::OwnedView<UpdateProviderRequestView<'static>>,
5319 > for UpdateProviderRequestOwnedView {
5320 fn from(
5321 inner: ::buffa::OwnedView<UpdateProviderRequestView<'static>>,
5322 ) -> Self {
5323 UpdateProviderRequestOwnedView(inner)
5324 }
5325 }
5326 impl ::core::convert::From<UpdateProviderRequestOwnedView>
5327 for ::buffa::OwnedView<UpdateProviderRequestView<'static>> {
5328 fn from(wrapper: UpdateProviderRequestOwnedView) -> Self {
5329 wrapper.0
5330 }
5331 }
5332 impl ::core::convert::AsRef<
5333 ::buffa::OwnedView<UpdateProviderRequestView<'static>>,
5334 > for UpdateProviderRequestOwnedView {
5335 fn as_ref(&self) -> &::buffa::OwnedView<UpdateProviderRequestView<'static>> {
5336 &self.0
5337 }
5338 }
5339 impl ::buffa::HasMessageView for super::super::UpdateProviderRequest {
5340 type View<'a> = UpdateProviderRequestView<'a>;
5341 type ViewHandle = UpdateProviderRequestOwnedView;
5342 }
5343 impl ::serde::Serialize for UpdateProviderRequestOwnedView {
5344 fn serialize<__S: ::serde::Serializer>(
5345 &self,
5346 __s: __S,
5347 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5348 ::serde::Serialize::serialize(&self.0, __s)
5349 }
5350 }
5351 #[derive(Clone, Debug, Default)]
5353 pub struct DeleteProviderRequestView<'a> {
5354 pub name: &'a str,
5358 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
5359 }
5360 impl<'a> DeleteProviderRequestView<'a> {
5361 #[doc(hidden)]
5369 pub fn _decode_depth(
5370 buf: &'a [u8],
5371 depth: u32,
5372 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5373 let mut view = Self::default();
5374 view._merge_into_view(buf, depth)?;
5375 ::core::result::Result::Ok(view)
5376 }
5377 #[doc(hidden)]
5385 pub fn _merge_into_view(
5386 &mut self,
5387 buf: &'a [u8],
5388 depth: u32,
5389 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5390 let _ = depth;
5391 #[allow(unused_variables)]
5392 let view = self;
5393 let mut cur: &'a [u8] = buf;
5394 while !cur.is_empty() {
5395 let before_tag = cur;
5396 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
5397 match tag.field_number() {
5398 1u32 => {
5399 if tag.wire_type()
5400 != ::buffa::encoding::WireType::LengthDelimited
5401 {
5402 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5403 field_number: 1u32,
5404 expected: 2u8,
5405 actual: tag.wire_type() as u8,
5406 });
5407 }
5408 view.name = ::buffa::types::borrow_str(&mut cur)?;
5409 }
5410 _ => {
5411 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
5412 let span_len = before_tag.len() - cur.len();
5413 view.__buffa_unknown_fields
5414 .push_raw(&before_tag[..span_len]);
5415 }
5416 }
5417 }
5418 ::core::result::Result::Ok(())
5419 }
5420 }
5421 impl<'a> ::buffa::MessageView<'a> for DeleteProviderRequestView<'a> {
5422 type Owned = super::super::DeleteProviderRequest;
5423 fn decode_view(
5424 buf: &'a [u8],
5425 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5426 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
5427 }
5428 fn decode_view_with_limit(
5429 buf: &'a [u8],
5430 depth: u32,
5431 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5432 Self::_decode_depth(buf, depth)
5433 }
5434 fn to_owned_message(&self) -> super::super::DeleteProviderRequest {
5435 self.to_owned_from_source(None)
5436 }
5437 #[allow(clippy::useless_conversion, clippy::needless_update)]
5438 fn to_owned_from_source(
5439 &self,
5440 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
5441 ) -> super::super::DeleteProviderRequest {
5442 #[allow(unused_imports)]
5443 use ::buffa::alloc::string::ToString as _;
5444 let _ = __buffa_src;
5445 super::super::DeleteProviderRequest {
5446 name: self.name.to_string(),
5447 __buffa_unknown_fields: self
5448 .__buffa_unknown_fields
5449 .to_owned()
5450 .unwrap_or_default()
5451 .into(),
5452 ..::core::default::Default::default()
5453 }
5454 }
5455 }
5456 impl<'a> ::buffa::ViewEncode<'a> for DeleteProviderRequestView<'a> {
5457 #[allow(clippy::needless_borrow, clippy::let_and_return)]
5458 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5459 #[allow(unused_imports)]
5460 use ::buffa::Enumeration as _;
5461 let mut size = 0u32;
5462 if !self.name.is_empty() {
5463 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
5464 }
5465 size += self.__buffa_unknown_fields.encoded_len() as u32;
5466 size
5467 }
5468 #[allow(clippy::needless_borrow)]
5469 fn write_to(
5470 &self,
5471 _cache: &mut ::buffa::SizeCache,
5472 buf: &mut impl ::buffa::bytes::BufMut,
5473 ) {
5474 #[allow(unused_imports)]
5475 use ::buffa::Enumeration as _;
5476 if !self.name.is_empty() {
5477 ::buffa::encoding::Tag::new(
5478 1u32,
5479 ::buffa::encoding::WireType::LengthDelimited,
5480 )
5481 .encode(buf);
5482 ::buffa::types::encode_string(&self.name, buf);
5483 }
5484 self.__buffa_unknown_fields.write_to(buf);
5485 }
5486 }
5487 impl<'__a> ::serde::Serialize for DeleteProviderRequestView<'__a> {
5499 fn serialize<__S: ::serde::Serializer>(
5500 &self,
5501 __s: __S,
5502 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5503 use ::serde::ser::SerializeMap as _;
5504 let mut __map = __s.serialize_map(::core::option::Option::None)?;
5505 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
5506 __map.serialize_entry("name", self.name)?;
5507 }
5508 __map.end()
5509 }
5510 }
5511 impl<'a> ::buffa::MessageName for DeleteProviderRequestView<'a> {
5512 const PACKAGE: &'static str = "unitycatalog.providers.v1";
5513 const NAME: &'static str = "DeleteProviderRequest";
5514 const FULL_NAME: &'static str = "unitycatalog.providers.v1.DeleteProviderRequest";
5515 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.providers.v1.DeleteProviderRequest";
5516 }
5517 impl<'v> ::buffa::DefaultViewInstance for DeleteProviderRequestView<'v> {
5518 fn default_view_instance<'a>() -> &'a Self
5519 where
5520 Self: 'a,
5521 {
5522 static VALUE: ::buffa::__private::OnceBox<
5523 DeleteProviderRequestView<'static>,
5524 > = ::buffa::__private::OnceBox::new();
5525 VALUE
5526 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
5527 <DeleteProviderRequestView<'static>>::default(),
5528 ))
5529 }
5530 }
5531 impl ::buffa::ViewReborrow for DeleteProviderRequestView<'static> {
5532 type Reborrowed<'b> = DeleteProviderRequestView<'b>;
5533 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
5534 this
5535 }
5536 }
5537 #[derive(Clone, Debug)]
5543 pub struct DeleteProviderRequestOwnedView(
5544 ::buffa::OwnedView<DeleteProviderRequestView<'static>>,
5545 );
5546 impl DeleteProviderRequestOwnedView {
5547 pub fn decode(
5557 bytes: ::buffa::bytes::Bytes,
5558 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5559 ::core::result::Result::Ok(
5560 DeleteProviderRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
5561 )
5562 }
5563 pub fn decode_with_options(
5571 bytes: ::buffa::bytes::Bytes,
5572 opts: &::buffa::DecodeOptions,
5573 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5574 ::core::result::Result::Ok(
5575 DeleteProviderRequestOwnedView(
5576 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5577 ),
5578 )
5579 }
5580 pub fn from_owned(
5587 msg: &super::super::DeleteProviderRequest,
5588 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5589 ::core::result::Result::Ok(
5590 DeleteProviderRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
5591 )
5592 }
5593 #[must_use]
5595 pub fn view(&self) -> &DeleteProviderRequestView<'_> {
5596 self.0.reborrow()
5597 }
5598 #[must_use]
5600 pub fn to_owned_message(&self) -> super::super::DeleteProviderRequest {
5601 self.0.to_owned_message()
5602 }
5603 #[must_use]
5605 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5606 self.0.bytes()
5607 }
5608 #[must_use]
5610 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5611 self.0.into_bytes()
5612 }
5613 #[must_use]
5617 pub fn name(&self) -> &'_ str {
5618 self.0.reborrow().name
5619 }
5620 }
5621 impl ::core::convert::From<
5622 ::buffa::OwnedView<DeleteProviderRequestView<'static>>,
5623 > for DeleteProviderRequestOwnedView {
5624 fn from(
5625 inner: ::buffa::OwnedView<DeleteProviderRequestView<'static>>,
5626 ) -> Self {
5627 DeleteProviderRequestOwnedView(inner)
5628 }
5629 }
5630 impl ::core::convert::From<DeleteProviderRequestOwnedView>
5631 for ::buffa::OwnedView<DeleteProviderRequestView<'static>> {
5632 fn from(wrapper: DeleteProviderRequestOwnedView) -> Self {
5633 wrapper.0
5634 }
5635 }
5636 impl ::core::convert::AsRef<
5637 ::buffa::OwnedView<DeleteProviderRequestView<'static>>,
5638 > for DeleteProviderRequestOwnedView {
5639 fn as_ref(&self) -> &::buffa::OwnedView<DeleteProviderRequestView<'static>> {
5640 &self.0
5641 }
5642 }
5643 impl ::buffa::HasMessageView for super::super::DeleteProviderRequest {
5644 type View<'a> = DeleteProviderRequestView<'a>;
5645 type ViewHandle = DeleteProviderRequestOwnedView;
5646 }
5647 impl ::serde::Serialize for DeleteProviderRequestOwnedView {
5648 fn serialize<__S: ::serde::Serializer>(
5649 &self,
5650 __s: __S,
5651 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5652 ::serde::Serialize::serialize(&self.0, __s)
5653 }
5654 }
5655 }
5656 pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
5658 reg.register_json_any(super::__PROVIDER_JSON_ANY);
5659 reg.register_json_any(super::__LIST_PROVIDERS_REQUEST_JSON_ANY);
5660 reg.register_json_any(super::__LIST_PROVIDERS_RESPONSE_JSON_ANY);
5661 reg.register_json_any(super::__CREATE_PROVIDER_REQUEST_JSON_ANY);
5662 reg.register_json_any(super::__GET_PROVIDER_REQUEST_JSON_ANY);
5663 reg.register_json_any(super::__UPDATE_PROVIDER_REQUEST_JSON_ANY);
5664 reg.register_json_any(super::__DELETE_PROVIDER_REQUEST_JSON_ANY);
5665 }
5666}
5667#[doc(inline)]
5668pub use self::__buffa::view::ProviderView;
5669#[doc(inline)]
5670pub use self::__buffa::view::ProviderOwnedView;
5671#[doc(inline)]
5672pub use self::__buffa::view::ListProvidersRequestView;
5673#[doc(inline)]
5674pub use self::__buffa::view::ListProvidersRequestOwnedView;
5675#[doc(inline)]
5676pub use self::__buffa::view::ListProvidersResponseView;
5677#[doc(inline)]
5678pub use self::__buffa::view::ListProvidersResponseOwnedView;
5679#[doc(inline)]
5680pub use self::__buffa::view::CreateProviderRequestView;
5681#[doc(inline)]
5682pub use self::__buffa::view::CreateProviderRequestOwnedView;
5683#[doc(inline)]
5684pub use self::__buffa::view::GetProviderRequestView;
5685#[doc(inline)]
5686pub use self::__buffa::view::GetProviderRequestOwnedView;
5687#[doc(inline)]
5688pub use self::__buffa::view::UpdateProviderRequestView;
5689#[doc(inline)]
5690pub use self::__buffa::view::UpdateProviderRequestOwnedView;
5691#[doc(inline)]
5692pub use self::__buffa::view::DeleteProviderRequestView;
5693#[doc(inline)]
5694pub use self::__buffa::view::DeleteProviderRequestOwnedView;
5695#[doc(inline)]
5696pub use self::__buffa::register_types;