1#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
5#[repr(i32)]
6pub enum InvocationProtocol {
7 INVOCATION_PROTOCOL_UNSPECIFIED = 0i32,
8 MCP = 1i32,
10 A2A = 2i32,
12 OPENAI = 3i32,
14 ANTHROPIC = 4i32,
16 REST = 5i32,
18}
19impl InvocationProtocol {
20 #[allow(non_upper_case_globals)]
22 pub const InvocationProtocolUnspecified: Self = Self::INVOCATION_PROTOCOL_UNSPECIFIED;
23 #[allow(non_upper_case_globals)]
25 pub const Mcp: Self = Self::MCP;
26 #[allow(non_upper_case_globals)]
28 pub const A2a: Self = Self::A2A;
29 #[allow(non_upper_case_globals)]
31 pub const Openai: Self = Self::OPENAI;
32 #[allow(non_upper_case_globals)]
34 pub const Anthropic: Self = Self::ANTHROPIC;
35 #[allow(non_upper_case_globals)]
37 pub const Rest: Self = Self::REST;
38}
39impl ::core::default::Default for InvocationProtocol {
40 fn default() -> Self {
41 Self::INVOCATION_PROTOCOL_UNSPECIFIED
42 }
43}
44impl ::serde::Serialize for InvocationProtocol {
45 fn serialize<S: ::serde::Serializer>(
46 &self,
47 s: S,
48 ) -> ::core::result::Result<S::Ok, S::Error> {
49 s.serialize_str(::buffa::Enumeration::proto_name(self))
50 }
51}
52impl<'de> ::serde::Deserialize<'de> for InvocationProtocol {
53 fn deserialize<D: ::serde::Deserializer<'de>>(
54 d: D,
55 ) -> ::core::result::Result<Self, D::Error> {
56 struct _V;
57 impl ::serde::de::Visitor<'_> for _V {
58 type Value = InvocationProtocol;
59 fn expecting(
60 &self,
61 f: &mut ::core::fmt::Formatter<'_>,
62 ) -> ::core::fmt::Result {
63 f.write_str(
64 concat!(
65 "a string, integer, or null for ", stringify!(InvocationProtocol)
66 ),
67 )
68 }
69 fn visit_str<E: ::serde::de::Error>(
70 self,
71 v: &str,
72 ) -> ::core::result::Result<InvocationProtocol, E> {
73 <InvocationProtocol as ::buffa::Enumeration>::from_proto_name(v)
74 .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
75 }
76 fn visit_i64<E: ::serde::de::Error>(
77 self,
78 v: i64,
79 ) -> ::core::result::Result<InvocationProtocol, E> {
80 let v32 = i32::try_from(v)
81 .map_err(|_| {
82 ::serde::de::Error::custom(
83 ::buffa::alloc::format!("enum value {v} out of i32 range"),
84 )
85 })?;
86 <InvocationProtocol as ::buffa::Enumeration>::from_i32(v32)
87 .ok_or_else(|| {
88 ::serde::de::Error::custom(
89 ::buffa::alloc::format!("unknown enum value {v32}"),
90 )
91 })
92 }
93 fn visit_u64<E: ::serde::de::Error>(
94 self,
95 v: u64,
96 ) -> ::core::result::Result<InvocationProtocol, E> {
97 let v32 = i32::try_from(v)
98 .map_err(|_| {
99 ::serde::de::Error::custom(
100 ::buffa::alloc::format!("enum value {v} out of i32 range"),
101 )
102 })?;
103 <InvocationProtocol as ::buffa::Enumeration>::from_i32(v32)
104 .ok_or_else(|| {
105 ::serde::de::Error::custom(
106 ::buffa::alloc::format!("unknown enum value {v32}"),
107 )
108 })
109 }
110 fn visit_unit<E: ::serde::de::Error>(
111 self,
112 ) -> ::core::result::Result<InvocationProtocol, E> {
113 ::core::result::Result::Ok(::core::default::Default::default())
114 }
115 }
116 d.deserialize_any(_V)
117 }
118}
119impl ::buffa::json_helpers::ProtoElemJson for InvocationProtocol {
120 fn serialize_proto_json<S: ::serde::Serializer>(
121 v: &Self,
122 s: S,
123 ) -> ::core::result::Result<S::Ok, S::Error> {
124 ::serde::Serialize::serialize(v, s)
125 }
126 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
127 d: D,
128 ) -> ::core::result::Result<Self, D::Error> {
129 <Self as ::serde::Deserialize>::deserialize(d)
130 }
131}
132impl ::buffa::Enumeration for InvocationProtocol {
133 fn from_i32(value: i32) -> ::core::option::Option<Self> {
134 match value {
135 0i32 => ::core::option::Option::Some(Self::INVOCATION_PROTOCOL_UNSPECIFIED),
136 1i32 => ::core::option::Option::Some(Self::MCP),
137 2i32 => ::core::option::Option::Some(Self::A2A),
138 3i32 => ::core::option::Option::Some(Self::OPENAI),
139 4i32 => ::core::option::Option::Some(Self::ANTHROPIC),
140 5i32 => ::core::option::Option::Some(Self::REST),
141 _ => ::core::option::Option::None,
142 }
143 }
144 fn to_i32(&self) -> i32 {
145 *self as i32
146 }
147 fn proto_name(&self) -> &'static str {
148 match self {
149 Self::INVOCATION_PROTOCOL_UNSPECIFIED => "INVOCATION_PROTOCOL_UNSPECIFIED",
150 Self::MCP => "MCP",
151 Self::A2A => "A2A",
152 Self::OPENAI => "OPENAI",
153 Self::ANTHROPIC => "ANTHROPIC",
154 Self::REST => "REST",
155 }
156 }
157 fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
158 match name {
159 "INVOCATION_PROTOCOL_UNSPECIFIED" => {
160 ::core::option::Option::Some(Self::INVOCATION_PROTOCOL_UNSPECIFIED)
161 }
162 "MCP" => ::core::option::Option::Some(Self::MCP),
163 "A2A" => ::core::option::Option::Some(Self::A2A),
164 "OPENAI" => ::core::option::Option::Some(Self::OPENAI),
165 "ANTHROPIC" => ::core::option::Option::Some(Self::ANTHROPIC),
166 "REST" => ::core::option::Option::Some(Self::REST),
167 _ => ::core::option::Option::None,
168 }
169 }
170 fn values() -> &'static [Self] {
171 &[
172 Self::INVOCATION_PROTOCOL_UNSPECIFIED,
173 Self::MCP,
174 Self::A2A,
175 Self::OPENAI,
176 Self::ANTHROPIC,
177 Self::REST,
178 ]
179 }
180}
181#[derive(Clone, PartialEq, Default)]
183#[derive(::serde::Serialize, ::serde::Deserialize)]
184#[serde(default)]
185pub struct Agent {
186 #[serde(
190 rename = "name",
191 with = "::buffa::json_helpers::proto_string",
192 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
193 )]
194 pub name: ::buffa::alloc::string::String,
195 #[serde(
199 rename = "catalog_name",
200 alias = "catalogName",
201 with = "::buffa::json_helpers::proto_string",
202 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
203 )]
204 pub catalog_name: ::buffa::alloc::string::String,
205 #[serde(
209 rename = "schema_name",
210 alias = "schemaName",
211 with = "::buffa::json_helpers::proto_string",
212 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
213 )]
214 pub schema_name: ::buffa::alloc::string::String,
215 #[serde(
219 rename = "full_name",
220 alias = "fullName",
221 with = "::buffa::json_helpers::proto_string",
222 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
223 )]
224 pub full_name: ::buffa::alloc::string::String,
225 #[serde(
229 rename = "agent_id",
230 alias = "agentId",
231 with = "::buffa::json_helpers::proto_string",
232 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
233 )]
234 pub agent_id: ::buffa::alloc::string::String,
235 #[serde(
239 rename = "invocation_protocol",
240 alias = "invocationProtocol",
241 with = "::buffa::json_helpers::proto_enum",
242 skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
243 )]
244 pub invocation_protocol: ::buffa::EnumValue<InvocationProtocol>,
245 #[serde(
249 rename = "endpoint",
250 with = "::buffa::json_helpers::proto_string",
251 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
252 )]
253 pub endpoint: ::buffa::alloc::string::String,
254 #[serde(
259 rename = "description",
260 skip_serializing_if = "::core::option::Option::is_none"
261 )]
262 pub description: ::core::option::Option<::buffa::alloc::string::String>,
263 #[serde(
268 rename = "capabilities",
269 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
270 deserialize_with = "::buffa::json_helpers::null_as_default"
271 )]
272 pub capabilities: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
273 #[serde(
279 rename = "input_schema",
280 alias = "inputSchema",
281 skip_serializing_if = "::core::option::Option::is_none"
282 )]
283 pub input_schema: ::core::option::Option<::buffa::alloc::string::String>,
284 #[serde(rename = "owner", skip_serializing_if = "::core::option::Option::is_none")]
288 pub owner: ::core::option::Option<::buffa::alloc::string::String>,
289 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
293 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
294 #[serde(
298 rename = "created_at",
299 alias = "createdAt",
300 with = "::buffa::json_helpers::opt_int64",
301 skip_serializing_if = "::core::option::Option::is_none"
302 )]
303 pub created_at: ::core::option::Option<i64>,
304 #[serde(
308 rename = "created_by",
309 alias = "createdBy",
310 skip_serializing_if = "::core::option::Option::is_none"
311 )]
312 pub created_by: ::core::option::Option<::buffa::alloc::string::String>,
313 #[serde(
317 rename = "updated_at",
318 alias = "updatedAt",
319 with = "::buffa::json_helpers::opt_int64",
320 skip_serializing_if = "::core::option::Option::is_none"
321 )]
322 pub updated_at: ::core::option::Option<i64>,
323 #[serde(
327 rename = "updated_by",
328 alias = "updatedBy",
329 skip_serializing_if = "::core::option::Option::is_none"
330 )]
331 pub updated_by: ::core::option::Option<::buffa::alloc::string::String>,
332 #[serde(
336 rename = "metastore_id",
337 alias = "metastoreId",
338 skip_serializing_if = "::core::option::Option::is_none"
339 )]
340 pub metastore_id: ::core::option::Option<::buffa::alloc::string::String>,
341 #[serde(skip)]
342 #[doc(hidden)]
343 pub __buffa_unknown_fields: ::buffa::UnknownFields,
344}
345impl ::core::fmt::Debug for Agent {
346 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
347 f.debug_struct("Agent")
348 .field("name", &self.name)
349 .field("catalog_name", &self.catalog_name)
350 .field("schema_name", &self.schema_name)
351 .field("full_name", &self.full_name)
352 .field("agent_id", &self.agent_id)
353 .field("invocation_protocol", &self.invocation_protocol)
354 .field("endpoint", &self.endpoint)
355 .field("description", &self.description)
356 .field("capabilities", &self.capabilities)
357 .field("input_schema", &self.input_schema)
358 .field("owner", &self.owner)
359 .field("comment", &self.comment)
360 .field("created_at", &self.created_at)
361 .field("created_by", &self.created_by)
362 .field("updated_at", &self.updated_at)
363 .field("updated_by", &self.updated_by)
364 .field("metastore_id", &self.metastore_id)
365 .finish()
366 }
367}
368impl Agent {
369 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.Agent";
374}
375impl Agent {
376 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
377 #[inline]
378 pub fn with_description(
380 mut self,
381 value: impl Into<::buffa::alloc::string::String>,
382 ) -> Self {
383 self.description = Some(value.into());
384 self
385 }
386 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
387 #[inline]
388 pub fn with_input_schema(
390 mut self,
391 value: impl Into<::buffa::alloc::string::String>,
392 ) -> Self {
393 self.input_schema = Some(value.into());
394 self
395 }
396 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
397 #[inline]
398 pub fn with_owner(
400 mut self,
401 value: impl Into<::buffa::alloc::string::String>,
402 ) -> Self {
403 self.owner = Some(value.into());
404 self
405 }
406 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
407 #[inline]
408 pub fn with_comment(
410 mut self,
411 value: impl Into<::buffa::alloc::string::String>,
412 ) -> Self {
413 self.comment = Some(value.into());
414 self
415 }
416 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
417 #[inline]
418 pub fn with_created_at(mut self, value: i64) -> Self {
420 self.created_at = Some(value);
421 self
422 }
423 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
424 #[inline]
425 pub fn with_created_by(
427 mut self,
428 value: impl Into<::buffa::alloc::string::String>,
429 ) -> Self {
430 self.created_by = Some(value.into());
431 self
432 }
433 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
434 #[inline]
435 pub fn with_updated_at(mut self, value: i64) -> Self {
437 self.updated_at = Some(value);
438 self
439 }
440 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
441 #[inline]
442 pub fn with_updated_by(
444 mut self,
445 value: impl Into<::buffa::alloc::string::String>,
446 ) -> Self {
447 self.updated_by = Some(value.into());
448 self
449 }
450 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
451 #[inline]
452 pub fn with_metastore_id(
454 mut self,
455 value: impl Into<::buffa::alloc::string::String>,
456 ) -> Self {
457 self.metastore_id = Some(value.into());
458 self
459 }
460}
461impl ::buffa::DefaultInstance for Agent {
462 fn default_instance() -> &'static Self {
463 static VALUE: ::buffa::__private::OnceBox<Agent> = ::buffa::__private::OnceBox::new();
464 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
465 }
466}
467impl ::buffa::MessageName for Agent {
468 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
469 const NAME: &'static str = "Agent";
470 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.Agent";
471 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.Agent";
472}
473impl ::buffa::Message for Agent {
474 #[allow(clippy::let_and_return)]
480 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
481 #[allow(unused_imports)]
482 use ::buffa::Enumeration as _;
483 let mut size = 0u32;
484 if !self.name.is_empty() {
485 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
486 }
487 if !self.catalog_name.is_empty() {
488 size += 1u32 + ::buffa::types::string_encoded_len(&self.catalog_name) as u32;
489 }
490 if !self.schema_name.is_empty() {
491 size += 1u32 + ::buffa::types::string_encoded_len(&self.schema_name) as u32;
492 }
493 if !self.full_name.is_empty() {
494 size += 1u32 + ::buffa::types::string_encoded_len(&self.full_name) as u32;
495 }
496 if !self.agent_id.is_empty() {
497 size += 1u32 + ::buffa::types::string_encoded_len(&self.agent_id) as u32;
498 }
499 {
500 let val = self.invocation_protocol.to_i32();
501 if val != 0 {
502 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
503 }
504 }
505 if !self.endpoint.is_empty() {
506 size += 1u32 + ::buffa::types::string_encoded_len(&self.endpoint) as u32;
507 }
508 if let Some(ref v) = self.description {
509 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
510 }
511 for v in &self.capabilities {
512 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
513 }
514 if let Some(ref v) = self.input_schema {
515 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
516 }
517 if let Some(ref v) = self.owner {
518 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
519 }
520 if let Some(ref v) = self.comment {
521 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
522 }
523 if let Some(v) = self.created_at {
524 size += 2u32 + ::buffa::types::int64_encoded_len(v) as u32;
525 }
526 if let Some(ref v) = self.created_by {
527 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
528 }
529 if let Some(v) = self.updated_at {
530 size += 2u32 + ::buffa::types::int64_encoded_len(v) as u32;
531 }
532 if let Some(ref v) = self.updated_by {
533 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
534 }
535 if let Some(ref v) = self.metastore_id {
536 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
537 }
538 size += self.__buffa_unknown_fields.encoded_len() as u32;
539 size
540 }
541 fn write_to(
542 &self,
543 _cache: &mut ::buffa::SizeCache,
544 buf: &mut impl ::buffa::bytes::BufMut,
545 ) {
546 #[allow(unused_imports)]
547 use ::buffa::Enumeration as _;
548 if !self.name.is_empty() {
549 ::buffa::encoding::Tag::new(
550 1u32,
551 ::buffa::encoding::WireType::LengthDelimited,
552 )
553 .encode(buf);
554 ::buffa::types::encode_string(&self.name, buf);
555 }
556 if !self.catalog_name.is_empty() {
557 ::buffa::encoding::Tag::new(
558 2u32,
559 ::buffa::encoding::WireType::LengthDelimited,
560 )
561 .encode(buf);
562 ::buffa::types::encode_string(&self.catalog_name, buf);
563 }
564 if !self.schema_name.is_empty() {
565 ::buffa::encoding::Tag::new(
566 3u32,
567 ::buffa::encoding::WireType::LengthDelimited,
568 )
569 .encode(buf);
570 ::buffa::types::encode_string(&self.schema_name, buf);
571 }
572 if !self.full_name.is_empty() {
573 ::buffa::encoding::Tag::new(
574 4u32,
575 ::buffa::encoding::WireType::LengthDelimited,
576 )
577 .encode(buf);
578 ::buffa::types::encode_string(&self.full_name, buf);
579 }
580 if !self.agent_id.is_empty() {
581 ::buffa::encoding::Tag::new(
582 5u32,
583 ::buffa::encoding::WireType::LengthDelimited,
584 )
585 .encode(buf);
586 ::buffa::types::encode_string(&self.agent_id, buf);
587 }
588 {
589 let val = self.invocation_protocol.to_i32();
590 if val != 0 {
591 ::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
592 .encode(buf);
593 ::buffa::types::encode_int32(val, buf);
594 }
595 }
596 if !self.endpoint.is_empty() {
597 ::buffa::encoding::Tag::new(
598 7u32,
599 ::buffa::encoding::WireType::LengthDelimited,
600 )
601 .encode(buf);
602 ::buffa::types::encode_string(&self.endpoint, buf);
603 }
604 if let Some(ref v) = self.description {
605 ::buffa::encoding::Tag::new(
606 8u32,
607 ::buffa::encoding::WireType::LengthDelimited,
608 )
609 .encode(buf);
610 ::buffa::types::encode_string(v, buf);
611 }
612 for v in &self.capabilities {
613 ::buffa::encoding::Tag::new(
614 9u32,
615 ::buffa::encoding::WireType::LengthDelimited,
616 )
617 .encode(buf);
618 ::buffa::types::encode_string(v, buf);
619 }
620 if let Some(ref v) = self.input_schema {
621 ::buffa::encoding::Tag::new(
622 10u32,
623 ::buffa::encoding::WireType::LengthDelimited,
624 )
625 .encode(buf);
626 ::buffa::types::encode_string(v, buf);
627 }
628 if let Some(ref v) = self.owner {
629 ::buffa::encoding::Tag::new(
630 11u32,
631 ::buffa::encoding::WireType::LengthDelimited,
632 )
633 .encode(buf);
634 ::buffa::types::encode_string(v, buf);
635 }
636 if let Some(ref v) = self.comment {
637 ::buffa::encoding::Tag::new(
638 12u32,
639 ::buffa::encoding::WireType::LengthDelimited,
640 )
641 .encode(buf);
642 ::buffa::types::encode_string(v, buf);
643 }
644 if let Some(v) = self.created_at {
645 ::buffa::encoding::Tag::new(1000u32, ::buffa::encoding::WireType::Varint)
646 .encode(buf);
647 ::buffa::types::encode_int64(v, buf);
648 }
649 if let Some(ref v) = self.created_by {
650 ::buffa::encoding::Tag::new(
651 1001u32,
652 ::buffa::encoding::WireType::LengthDelimited,
653 )
654 .encode(buf);
655 ::buffa::types::encode_string(v, buf);
656 }
657 if let Some(v) = self.updated_at {
658 ::buffa::encoding::Tag::new(1002u32, ::buffa::encoding::WireType::Varint)
659 .encode(buf);
660 ::buffa::types::encode_int64(v, buf);
661 }
662 if let Some(ref v) = self.updated_by {
663 ::buffa::encoding::Tag::new(
664 1003u32,
665 ::buffa::encoding::WireType::LengthDelimited,
666 )
667 .encode(buf);
668 ::buffa::types::encode_string(v, buf);
669 }
670 if let Some(ref v) = self.metastore_id {
671 ::buffa::encoding::Tag::new(
672 1004u32,
673 ::buffa::encoding::WireType::LengthDelimited,
674 )
675 .encode(buf);
676 ::buffa::types::encode_string(v, buf);
677 }
678 self.__buffa_unknown_fields.write_to(buf);
679 }
680 fn merge_field(
681 &mut self,
682 tag: ::buffa::encoding::Tag,
683 buf: &mut impl ::buffa::bytes::Buf,
684 depth: u32,
685 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
686 #[allow(unused_imports)]
687 use ::buffa::bytes::Buf as _;
688 #[allow(unused_imports)]
689 use ::buffa::Enumeration as _;
690 match tag.field_number() {
691 1u32 => {
692 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
693 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
694 field_number: 1u32,
695 expected: 2u8,
696 actual: tag.wire_type() as u8,
697 });
698 }
699 ::buffa::types::merge_string(&mut self.name, buf)?;
700 }
701 2u32 => {
702 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
703 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
704 field_number: 2u32,
705 expected: 2u8,
706 actual: tag.wire_type() as u8,
707 });
708 }
709 ::buffa::types::merge_string(&mut self.catalog_name, buf)?;
710 }
711 3u32 => {
712 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
713 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
714 field_number: 3u32,
715 expected: 2u8,
716 actual: tag.wire_type() as u8,
717 });
718 }
719 ::buffa::types::merge_string(&mut self.schema_name, buf)?;
720 }
721 4u32 => {
722 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
723 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
724 field_number: 4u32,
725 expected: 2u8,
726 actual: tag.wire_type() as u8,
727 });
728 }
729 ::buffa::types::merge_string(&mut self.full_name, buf)?;
730 }
731 5u32 => {
732 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
733 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
734 field_number: 5u32,
735 expected: 2u8,
736 actual: tag.wire_type() as u8,
737 });
738 }
739 ::buffa::types::merge_string(&mut self.agent_id, buf)?;
740 }
741 6u32 => {
742 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
743 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
744 field_number: 6u32,
745 expected: 0u8,
746 actual: tag.wire_type() as u8,
747 });
748 }
749 self.invocation_protocol = ::buffa::EnumValue::from(
750 ::buffa::types::decode_int32(buf)?,
751 );
752 }
753 7u32 => {
754 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
755 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
756 field_number: 7u32,
757 expected: 2u8,
758 actual: tag.wire_type() as u8,
759 });
760 }
761 ::buffa::types::merge_string(&mut self.endpoint, buf)?;
762 }
763 8u32 => {
764 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
765 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
766 field_number: 8u32,
767 expected: 2u8,
768 actual: tag.wire_type() as u8,
769 });
770 }
771 ::buffa::types::merge_string(
772 self
773 .description
774 .get_or_insert_with(::buffa::alloc::string::String::new),
775 buf,
776 )?;
777 }
778 9u32 => {
779 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
780 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
781 field_number: 9u32,
782 expected: 2u8,
783 actual: tag.wire_type() as u8,
784 });
785 }
786 self.capabilities.push(::buffa::types::decode_string(buf)?);
787 }
788 10u32 => {
789 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
790 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
791 field_number: 10u32,
792 expected: 2u8,
793 actual: tag.wire_type() as u8,
794 });
795 }
796 ::buffa::types::merge_string(
797 self
798 .input_schema
799 .get_or_insert_with(::buffa::alloc::string::String::new),
800 buf,
801 )?;
802 }
803 11u32 => {
804 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
805 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
806 field_number: 11u32,
807 expected: 2u8,
808 actual: tag.wire_type() as u8,
809 });
810 }
811 ::buffa::types::merge_string(
812 self.owner.get_or_insert_with(::buffa::alloc::string::String::new),
813 buf,
814 )?;
815 }
816 12u32 => {
817 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
818 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
819 field_number: 12u32,
820 expected: 2u8,
821 actual: tag.wire_type() as u8,
822 });
823 }
824 ::buffa::types::merge_string(
825 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
826 buf,
827 )?;
828 }
829 1000u32 => {
830 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
831 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
832 field_number: 1000u32,
833 expected: 0u8,
834 actual: tag.wire_type() as u8,
835 });
836 }
837 self.created_at = ::core::option::Option::Some(
838 ::buffa::types::decode_int64(buf)?,
839 );
840 }
841 1001u32 => {
842 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
843 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
844 field_number: 1001u32,
845 expected: 2u8,
846 actual: tag.wire_type() as u8,
847 });
848 }
849 ::buffa::types::merge_string(
850 self
851 .created_by
852 .get_or_insert_with(::buffa::alloc::string::String::new),
853 buf,
854 )?;
855 }
856 1002u32 => {
857 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
858 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
859 field_number: 1002u32,
860 expected: 0u8,
861 actual: tag.wire_type() as u8,
862 });
863 }
864 self.updated_at = ::core::option::Option::Some(
865 ::buffa::types::decode_int64(buf)?,
866 );
867 }
868 1003u32 => {
869 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
870 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
871 field_number: 1003u32,
872 expected: 2u8,
873 actual: tag.wire_type() as u8,
874 });
875 }
876 ::buffa::types::merge_string(
877 self
878 .updated_by
879 .get_or_insert_with(::buffa::alloc::string::String::new),
880 buf,
881 )?;
882 }
883 1004u32 => {
884 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
885 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
886 field_number: 1004u32,
887 expected: 2u8,
888 actual: tag.wire_type() as u8,
889 });
890 }
891 ::buffa::types::merge_string(
892 self
893 .metastore_id
894 .get_or_insert_with(::buffa::alloc::string::String::new),
895 buf,
896 )?;
897 }
898 _ => {
899 self.__buffa_unknown_fields
900 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
901 }
902 }
903 ::core::result::Result::Ok(())
904 }
905 fn clear(&mut self) {
906 self.name.clear();
907 self.catalog_name.clear();
908 self.schema_name.clear();
909 self.full_name.clear();
910 self.agent_id.clear();
911 self.invocation_protocol = ::buffa::EnumValue::from(0);
912 self.endpoint.clear();
913 self.description = ::core::option::Option::None;
914 self.capabilities.clear();
915 self.input_schema = ::core::option::Option::None;
916 self.owner = ::core::option::Option::None;
917 self.comment = ::core::option::Option::None;
918 self.created_at = ::core::option::Option::None;
919 self.created_by = ::core::option::Option::None;
920 self.updated_at = ::core::option::Option::None;
921 self.updated_by = ::core::option::Option::None;
922 self.metastore_id = ::core::option::Option::None;
923 self.__buffa_unknown_fields.clear();
924 }
925}
926impl ::buffa::ExtensionSet for Agent {
927 const PROTO_FQN: &'static str = "unitycatalog.agents.v0alpha1.Agent";
928 fn unknown_fields(&self) -> &::buffa::UnknownFields {
929 &self.__buffa_unknown_fields
930 }
931 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
932 &mut self.__buffa_unknown_fields
933 }
934}
935impl ::buffa::json_helpers::ProtoElemJson for Agent {
936 fn serialize_proto_json<S: ::serde::Serializer>(
937 v: &Self,
938 s: S,
939 ) -> ::core::result::Result<S::Ok, S::Error> {
940 ::serde::Serialize::serialize(v, s)
941 }
942 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
943 d: D,
944 ) -> ::core::result::Result<Self, D::Error> {
945 <Self as ::serde::Deserialize>::deserialize(d)
946 }
947}
948#[doc(hidden)]
949pub const __AGENT_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
950 type_url: "type.googleapis.com/unitycatalog.agents.v0alpha1.Agent",
951 to_json: ::buffa::type_registry::any_to_json::<Agent>,
952 from_json: ::buffa::type_registry::any_from_json::<Agent>,
953 is_wkt: false,
954};
955#[derive(Clone, PartialEq, Default)]
957#[derive(::serde::Serialize, ::serde::Deserialize)]
958#[serde(default)]
959pub struct ListAgentsRequest {
960 #[serde(
964 rename = "catalog_name",
965 alias = "catalogName",
966 with = "::buffa::json_helpers::proto_string",
967 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
968 )]
969 pub catalog_name: ::buffa::alloc::string::String,
970 #[serde(
974 rename = "schema_name",
975 alias = "schemaName",
976 with = "::buffa::json_helpers::proto_string",
977 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
978 )]
979 pub schema_name: ::buffa::alloc::string::String,
980 #[serde(
984 rename = "max_results",
985 alias = "maxResults",
986 with = "::buffa::json_helpers::opt_int32",
987 skip_serializing_if = "::core::option::Option::is_none"
988 )]
989 pub max_results: ::core::option::Option<i32>,
990 #[serde(
994 rename = "page_token",
995 alias = "pageToken",
996 skip_serializing_if = "::core::option::Option::is_none"
997 )]
998 pub page_token: ::core::option::Option<::buffa::alloc::string::String>,
999 #[serde(
1004 rename = "include_browse",
1005 alias = "includeBrowse",
1006 skip_serializing_if = "::core::option::Option::is_none"
1007 )]
1008 pub include_browse: ::core::option::Option<bool>,
1009 #[serde(skip)]
1010 #[doc(hidden)]
1011 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1012}
1013impl ::core::fmt::Debug for ListAgentsRequest {
1014 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1015 f.debug_struct("ListAgentsRequest")
1016 .field("catalog_name", &self.catalog_name)
1017 .field("schema_name", &self.schema_name)
1018 .field("max_results", &self.max_results)
1019 .field("page_token", &self.page_token)
1020 .field("include_browse", &self.include_browse)
1021 .finish()
1022 }
1023}
1024impl ListAgentsRequest {
1025 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.ListAgentsRequest";
1030}
1031impl ListAgentsRequest {
1032 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1033 #[inline]
1034 pub fn with_max_results(mut self, value: i32) -> Self {
1036 self.max_results = Some(value);
1037 self
1038 }
1039 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1040 #[inline]
1041 pub fn with_page_token(
1043 mut self,
1044 value: impl Into<::buffa::alloc::string::String>,
1045 ) -> Self {
1046 self.page_token = Some(value.into());
1047 self
1048 }
1049 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1050 #[inline]
1051 pub fn with_include_browse(mut self, value: bool) -> Self {
1053 self.include_browse = Some(value);
1054 self
1055 }
1056}
1057impl ::buffa::DefaultInstance for ListAgentsRequest {
1058 fn default_instance() -> &'static Self {
1059 static VALUE: ::buffa::__private::OnceBox<ListAgentsRequest> = ::buffa::__private::OnceBox::new();
1060 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1061 }
1062}
1063impl ::buffa::MessageName for ListAgentsRequest {
1064 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
1065 const NAME: &'static str = "ListAgentsRequest";
1066 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.ListAgentsRequest";
1067 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.ListAgentsRequest";
1068}
1069impl ::buffa::Message for ListAgentsRequest {
1070 #[allow(clippy::let_and_return)]
1076 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1077 #[allow(unused_imports)]
1078 use ::buffa::Enumeration as _;
1079 let mut size = 0u32;
1080 if !self.catalog_name.is_empty() {
1081 size += 1u32 + ::buffa::types::string_encoded_len(&self.catalog_name) as u32;
1082 }
1083 if !self.schema_name.is_empty() {
1084 size += 1u32 + ::buffa::types::string_encoded_len(&self.schema_name) as u32;
1085 }
1086 if let Some(v) = self.max_results {
1087 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
1088 }
1089 if let Some(ref v) = self.page_token {
1090 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1091 }
1092 if self.include_browse.is_some() {
1093 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1094 }
1095 size += self.__buffa_unknown_fields.encoded_len() as u32;
1096 size
1097 }
1098 fn write_to(
1099 &self,
1100 _cache: &mut ::buffa::SizeCache,
1101 buf: &mut impl ::buffa::bytes::BufMut,
1102 ) {
1103 #[allow(unused_imports)]
1104 use ::buffa::Enumeration as _;
1105 if !self.catalog_name.is_empty() {
1106 ::buffa::encoding::Tag::new(
1107 1u32,
1108 ::buffa::encoding::WireType::LengthDelimited,
1109 )
1110 .encode(buf);
1111 ::buffa::types::encode_string(&self.catalog_name, buf);
1112 }
1113 if !self.schema_name.is_empty() {
1114 ::buffa::encoding::Tag::new(
1115 2u32,
1116 ::buffa::encoding::WireType::LengthDelimited,
1117 )
1118 .encode(buf);
1119 ::buffa::types::encode_string(&self.schema_name, buf);
1120 }
1121 if let Some(v) = self.max_results {
1122 ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
1123 .encode(buf);
1124 ::buffa::types::encode_int32(v, buf);
1125 }
1126 if let Some(ref v) = self.page_token {
1127 ::buffa::encoding::Tag::new(
1128 4u32,
1129 ::buffa::encoding::WireType::LengthDelimited,
1130 )
1131 .encode(buf);
1132 ::buffa::types::encode_string(v, buf);
1133 }
1134 if let Some(v) = self.include_browse {
1135 ::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
1136 .encode(buf);
1137 ::buffa::types::encode_bool(v, buf);
1138 }
1139 self.__buffa_unknown_fields.write_to(buf);
1140 }
1141 fn merge_field(
1142 &mut self,
1143 tag: ::buffa::encoding::Tag,
1144 buf: &mut impl ::buffa::bytes::Buf,
1145 depth: u32,
1146 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1147 #[allow(unused_imports)]
1148 use ::buffa::bytes::Buf as _;
1149 #[allow(unused_imports)]
1150 use ::buffa::Enumeration as _;
1151 match tag.field_number() {
1152 1u32 => {
1153 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1154 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1155 field_number: 1u32,
1156 expected: 2u8,
1157 actual: tag.wire_type() as u8,
1158 });
1159 }
1160 ::buffa::types::merge_string(&mut self.catalog_name, buf)?;
1161 }
1162 2u32 => {
1163 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1164 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1165 field_number: 2u32,
1166 expected: 2u8,
1167 actual: tag.wire_type() as u8,
1168 });
1169 }
1170 ::buffa::types::merge_string(&mut self.schema_name, buf)?;
1171 }
1172 3u32 => {
1173 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1174 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1175 field_number: 3u32,
1176 expected: 0u8,
1177 actual: tag.wire_type() as u8,
1178 });
1179 }
1180 self.max_results = ::core::option::Option::Some(
1181 ::buffa::types::decode_int32(buf)?,
1182 );
1183 }
1184 4u32 => {
1185 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1186 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1187 field_number: 4u32,
1188 expected: 2u8,
1189 actual: tag.wire_type() as u8,
1190 });
1191 }
1192 ::buffa::types::merge_string(
1193 self
1194 .page_token
1195 .get_or_insert_with(::buffa::alloc::string::String::new),
1196 buf,
1197 )?;
1198 }
1199 5u32 => {
1200 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1201 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1202 field_number: 5u32,
1203 expected: 0u8,
1204 actual: tag.wire_type() as u8,
1205 });
1206 }
1207 self.include_browse = ::core::option::Option::Some(
1208 ::buffa::types::decode_bool(buf)?,
1209 );
1210 }
1211 _ => {
1212 self.__buffa_unknown_fields
1213 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1214 }
1215 }
1216 ::core::result::Result::Ok(())
1217 }
1218 fn clear(&mut self) {
1219 self.catalog_name.clear();
1220 self.schema_name.clear();
1221 self.max_results = ::core::option::Option::None;
1222 self.page_token = ::core::option::Option::None;
1223 self.include_browse = ::core::option::Option::None;
1224 self.__buffa_unknown_fields.clear();
1225 }
1226}
1227impl ::buffa::ExtensionSet for ListAgentsRequest {
1228 const PROTO_FQN: &'static str = "unitycatalog.agents.v0alpha1.ListAgentsRequest";
1229 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1230 &self.__buffa_unknown_fields
1231 }
1232 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1233 &mut self.__buffa_unknown_fields
1234 }
1235}
1236impl ::buffa::json_helpers::ProtoElemJson for ListAgentsRequest {
1237 fn serialize_proto_json<S: ::serde::Serializer>(
1238 v: &Self,
1239 s: S,
1240 ) -> ::core::result::Result<S::Ok, S::Error> {
1241 ::serde::Serialize::serialize(v, s)
1242 }
1243 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1244 d: D,
1245 ) -> ::core::result::Result<Self, D::Error> {
1246 <Self as ::serde::Deserialize>::deserialize(d)
1247 }
1248}
1249#[doc(hidden)]
1250pub const __LIST_AGENTS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1251 type_url: "type.googleapis.com/unitycatalog.agents.v0alpha1.ListAgentsRequest",
1252 to_json: ::buffa::type_registry::any_to_json::<ListAgentsRequest>,
1253 from_json: ::buffa::type_registry::any_from_json::<ListAgentsRequest>,
1254 is_wkt: false,
1255};
1256#[derive(Clone, PartialEq, Default)]
1258#[derive(::serde::Serialize, ::serde::Deserialize)]
1259#[serde(default)]
1260pub struct ListAgentsResponse {
1261 #[serde(
1265 rename = "agents",
1266 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1267 deserialize_with = "::buffa::json_helpers::null_as_default"
1268 )]
1269 pub agents: ::buffa::alloc::vec::Vec<Agent>,
1270 #[serde(
1277 rename = "next_page_token",
1278 alias = "nextPageToken",
1279 skip_serializing_if = "::core::option::Option::is_none"
1280 )]
1281 pub next_page_token: ::core::option::Option<::buffa::alloc::string::String>,
1282 #[serde(skip)]
1283 #[doc(hidden)]
1284 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1285}
1286impl ::core::fmt::Debug for ListAgentsResponse {
1287 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1288 f.debug_struct("ListAgentsResponse")
1289 .field("agents", &self.agents)
1290 .field("next_page_token", &self.next_page_token)
1291 .finish()
1292 }
1293}
1294impl ListAgentsResponse {
1295 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.ListAgentsResponse";
1300}
1301impl ListAgentsResponse {
1302 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1303 #[inline]
1304 pub fn with_next_page_token(
1306 mut self,
1307 value: impl Into<::buffa::alloc::string::String>,
1308 ) -> Self {
1309 self.next_page_token = Some(value.into());
1310 self
1311 }
1312}
1313impl ::buffa::DefaultInstance for ListAgentsResponse {
1314 fn default_instance() -> &'static Self {
1315 static VALUE: ::buffa::__private::OnceBox<ListAgentsResponse> = ::buffa::__private::OnceBox::new();
1316 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1317 }
1318}
1319impl ::buffa::MessageName for ListAgentsResponse {
1320 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
1321 const NAME: &'static str = "ListAgentsResponse";
1322 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.ListAgentsResponse";
1323 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.ListAgentsResponse";
1324}
1325impl ::buffa::Message for ListAgentsResponse {
1326 #[allow(clippy::let_and_return)]
1332 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1333 #[allow(unused_imports)]
1334 use ::buffa::Enumeration as _;
1335 let mut size = 0u32;
1336 for v in &self.agents {
1337 let __slot = __cache.reserve();
1338 let inner_size = v.compute_size(__cache);
1339 __cache.set(__slot, inner_size);
1340 size
1341 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1342 + inner_size;
1343 }
1344 if let Some(ref v) = self.next_page_token {
1345 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1346 }
1347 size += self.__buffa_unknown_fields.encoded_len() as u32;
1348 size
1349 }
1350 fn write_to(
1351 &self,
1352 __cache: &mut ::buffa::SizeCache,
1353 buf: &mut impl ::buffa::bytes::BufMut,
1354 ) {
1355 #[allow(unused_imports)]
1356 use ::buffa::Enumeration as _;
1357 for v in &self.agents {
1358 ::buffa::encoding::Tag::new(
1359 1u32,
1360 ::buffa::encoding::WireType::LengthDelimited,
1361 )
1362 .encode(buf);
1363 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1364 v.write_to(__cache, buf);
1365 }
1366 if let Some(ref v) = self.next_page_token {
1367 ::buffa::encoding::Tag::new(
1368 2u32,
1369 ::buffa::encoding::WireType::LengthDelimited,
1370 )
1371 .encode(buf);
1372 ::buffa::types::encode_string(v, buf);
1373 }
1374 self.__buffa_unknown_fields.write_to(buf);
1375 }
1376 fn merge_field(
1377 &mut self,
1378 tag: ::buffa::encoding::Tag,
1379 buf: &mut impl ::buffa::bytes::Buf,
1380 depth: u32,
1381 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1382 #[allow(unused_imports)]
1383 use ::buffa::bytes::Buf as _;
1384 #[allow(unused_imports)]
1385 use ::buffa::Enumeration as _;
1386 match tag.field_number() {
1387 1u32 => {
1388 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1389 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1390 field_number: 1u32,
1391 expected: 2u8,
1392 actual: tag.wire_type() as u8,
1393 });
1394 }
1395 let mut elem = ::core::default::Default::default();
1396 ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
1397 self.agents.push(elem);
1398 }
1399 2u32 => {
1400 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1401 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1402 field_number: 2u32,
1403 expected: 2u8,
1404 actual: tag.wire_type() as u8,
1405 });
1406 }
1407 ::buffa::types::merge_string(
1408 self
1409 .next_page_token
1410 .get_or_insert_with(::buffa::alloc::string::String::new),
1411 buf,
1412 )?;
1413 }
1414 _ => {
1415 self.__buffa_unknown_fields
1416 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1417 }
1418 }
1419 ::core::result::Result::Ok(())
1420 }
1421 fn clear(&mut self) {
1422 self.agents.clear();
1423 self.next_page_token = ::core::option::Option::None;
1424 self.__buffa_unknown_fields.clear();
1425 }
1426}
1427impl ::buffa::ExtensionSet for ListAgentsResponse {
1428 const PROTO_FQN: &'static str = "unitycatalog.agents.v0alpha1.ListAgentsResponse";
1429 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1430 &self.__buffa_unknown_fields
1431 }
1432 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1433 &mut self.__buffa_unknown_fields
1434 }
1435}
1436impl ::buffa::json_helpers::ProtoElemJson for ListAgentsResponse {
1437 fn serialize_proto_json<S: ::serde::Serializer>(
1438 v: &Self,
1439 s: S,
1440 ) -> ::core::result::Result<S::Ok, S::Error> {
1441 ::serde::Serialize::serialize(v, s)
1442 }
1443 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1444 d: D,
1445 ) -> ::core::result::Result<Self, D::Error> {
1446 <Self as ::serde::Deserialize>::deserialize(d)
1447 }
1448}
1449#[doc(hidden)]
1450pub const __LIST_AGENTS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1451 type_url: "type.googleapis.com/unitycatalog.agents.v0alpha1.ListAgentsResponse",
1452 to_json: ::buffa::type_registry::any_to_json::<ListAgentsResponse>,
1453 from_json: ::buffa::type_registry::any_from_json::<ListAgentsResponse>,
1454 is_wkt: false,
1455};
1456#[derive(Clone, PartialEq, Default)]
1458#[derive(::serde::Serialize, ::serde::Deserialize)]
1459#[serde(default)]
1460pub struct CreateAgentRequest {
1461 #[serde(
1465 rename = "catalog_name",
1466 alias = "catalogName",
1467 with = "::buffa::json_helpers::proto_string",
1468 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1469 )]
1470 pub catalog_name: ::buffa::alloc::string::String,
1471 #[serde(
1475 rename = "schema_name",
1476 alias = "schemaName",
1477 with = "::buffa::json_helpers::proto_string",
1478 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1479 )]
1480 pub schema_name: ::buffa::alloc::string::String,
1481 #[serde(
1485 rename = "name",
1486 with = "::buffa::json_helpers::proto_string",
1487 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1488 )]
1489 pub name: ::buffa::alloc::string::String,
1490 #[serde(
1494 rename = "invocation_protocol",
1495 alias = "invocationProtocol",
1496 with = "::buffa::json_helpers::proto_enum",
1497 skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
1498 )]
1499 pub invocation_protocol: ::buffa::EnumValue<InvocationProtocol>,
1500 #[serde(
1504 rename = "endpoint",
1505 with = "::buffa::json_helpers::proto_string",
1506 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1507 )]
1508 pub endpoint: ::buffa::alloc::string::String,
1509 #[serde(
1513 rename = "description",
1514 skip_serializing_if = "::core::option::Option::is_none"
1515 )]
1516 pub description: ::core::option::Option<::buffa::alloc::string::String>,
1517 #[serde(
1521 rename = "capabilities",
1522 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1523 deserialize_with = "::buffa::json_helpers::null_as_default"
1524 )]
1525 pub capabilities: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
1526 #[serde(
1530 rename = "input_schema",
1531 alias = "inputSchema",
1532 skip_serializing_if = "::core::option::Option::is_none"
1533 )]
1534 pub input_schema: ::core::option::Option<::buffa::alloc::string::String>,
1535 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
1539 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
1540 #[serde(skip)]
1541 #[doc(hidden)]
1542 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1543}
1544impl ::core::fmt::Debug for CreateAgentRequest {
1545 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1546 f.debug_struct("CreateAgentRequest")
1547 .field("catalog_name", &self.catalog_name)
1548 .field("schema_name", &self.schema_name)
1549 .field("name", &self.name)
1550 .field("invocation_protocol", &self.invocation_protocol)
1551 .field("endpoint", &self.endpoint)
1552 .field("description", &self.description)
1553 .field("capabilities", &self.capabilities)
1554 .field("input_schema", &self.input_schema)
1555 .field("comment", &self.comment)
1556 .finish()
1557 }
1558}
1559impl CreateAgentRequest {
1560 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.CreateAgentRequest";
1565}
1566impl CreateAgentRequest {
1567 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1568 #[inline]
1569 pub fn with_description(
1571 mut self,
1572 value: impl Into<::buffa::alloc::string::String>,
1573 ) -> Self {
1574 self.description = Some(value.into());
1575 self
1576 }
1577 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1578 #[inline]
1579 pub fn with_input_schema(
1581 mut self,
1582 value: impl Into<::buffa::alloc::string::String>,
1583 ) -> Self {
1584 self.input_schema = Some(value.into());
1585 self
1586 }
1587 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1588 #[inline]
1589 pub fn with_comment(
1591 mut self,
1592 value: impl Into<::buffa::alloc::string::String>,
1593 ) -> Self {
1594 self.comment = Some(value.into());
1595 self
1596 }
1597}
1598impl ::buffa::DefaultInstance for CreateAgentRequest {
1599 fn default_instance() -> &'static Self {
1600 static VALUE: ::buffa::__private::OnceBox<CreateAgentRequest> = ::buffa::__private::OnceBox::new();
1601 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1602 }
1603}
1604impl ::buffa::MessageName for CreateAgentRequest {
1605 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
1606 const NAME: &'static str = "CreateAgentRequest";
1607 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.CreateAgentRequest";
1608 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.CreateAgentRequest";
1609}
1610impl ::buffa::Message for CreateAgentRequest {
1611 #[allow(clippy::let_and_return)]
1617 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1618 #[allow(unused_imports)]
1619 use ::buffa::Enumeration as _;
1620 let mut size = 0u32;
1621 if !self.catalog_name.is_empty() {
1622 size += 1u32 + ::buffa::types::string_encoded_len(&self.catalog_name) as u32;
1623 }
1624 if !self.schema_name.is_empty() {
1625 size += 1u32 + ::buffa::types::string_encoded_len(&self.schema_name) as u32;
1626 }
1627 if !self.name.is_empty() {
1628 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
1629 }
1630 {
1631 let val = self.invocation_protocol.to_i32();
1632 if val != 0 {
1633 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
1634 }
1635 }
1636 if !self.endpoint.is_empty() {
1637 size += 1u32 + ::buffa::types::string_encoded_len(&self.endpoint) as u32;
1638 }
1639 if let Some(ref v) = self.description {
1640 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1641 }
1642 for v in &self.capabilities {
1643 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1644 }
1645 if let Some(ref v) = self.input_schema {
1646 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1647 }
1648 if let Some(ref v) = self.comment {
1649 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1650 }
1651 size += self.__buffa_unknown_fields.encoded_len() as u32;
1652 size
1653 }
1654 fn write_to(
1655 &self,
1656 _cache: &mut ::buffa::SizeCache,
1657 buf: &mut impl ::buffa::bytes::BufMut,
1658 ) {
1659 #[allow(unused_imports)]
1660 use ::buffa::Enumeration as _;
1661 if !self.catalog_name.is_empty() {
1662 ::buffa::encoding::Tag::new(
1663 1u32,
1664 ::buffa::encoding::WireType::LengthDelimited,
1665 )
1666 .encode(buf);
1667 ::buffa::types::encode_string(&self.catalog_name, buf);
1668 }
1669 if !self.schema_name.is_empty() {
1670 ::buffa::encoding::Tag::new(
1671 2u32,
1672 ::buffa::encoding::WireType::LengthDelimited,
1673 )
1674 .encode(buf);
1675 ::buffa::types::encode_string(&self.schema_name, buf);
1676 }
1677 if !self.name.is_empty() {
1678 ::buffa::encoding::Tag::new(
1679 3u32,
1680 ::buffa::encoding::WireType::LengthDelimited,
1681 )
1682 .encode(buf);
1683 ::buffa::types::encode_string(&self.name, buf);
1684 }
1685 {
1686 let val = self.invocation_protocol.to_i32();
1687 if val != 0 {
1688 ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
1689 .encode(buf);
1690 ::buffa::types::encode_int32(val, buf);
1691 }
1692 }
1693 if !self.endpoint.is_empty() {
1694 ::buffa::encoding::Tag::new(
1695 5u32,
1696 ::buffa::encoding::WireType::LengthDelimited,
1697 )
1698 .encode(buf);
1699 ::buffa::types::encode_string(&self.endpoint, buf);
1700 }
1701 if let Some(ref v) = self.description {
1702 ::buffa::encoding::Tag::new(
1703 6u32,
1704 ::buffa::encoding::WireType::LengthDelimited,
1705 )
1706 .encode(buf);
1707 ::buffa::types::encode_string(v, buf);
1708 }
1709 for v in &self.capabilities {
1710 ::buffa::encoding::Tag::new(
1711 7u32,
1712 ::buffa::encoding::WireType::LengthDelimited,
1713 )
1714 .encode(buf);
1715 ::buffa::types::encode_string(v, buf);
1716 }
1717 if let Some(ref v) = self.input_schema {
1718 ::buffa::encoding::Tag::new(
1719 8u32,
1720 ::buffa::encoding::WireType::LengthDelimited,
1721 )
1722 .encode(buf);
1723 ::buffa::types::encode_string(v, buf);
1724 }
1725 if let Some(ref v) = self.comment {
1726 ::buffa::encoding::Tag::new(
1727 9u32,
1728 ::buffa::encoding::WireType::LengthDelimited,
1729 )
1730 .encode(buf);
1731 ::buffa::types::encode_string(v, buf);
1732 }
1733 self.__buffa_unknown_fields.write_to(buf);
1734 }
1735 fn merge_field(
1736 &mut self,
1737 tag: ::buffa::encoding::Tag,
1738 buf: &mut impl ::buffa::bytes::Buf,
1739 depth: u32,
1740 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1741 #[allow(unused_imports)]
1742 use ::buffa::bytes::Buf as _;
1743 #[allow(unused_imports)]
1744 use ::buffa::Enumeration as _;
1745 match tag.field_number() {
1746 1u32 => {
1747 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1748 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1749 field_number: 1u32,
1750 expected: 2u8,
1751 actual: tag.wire_type() as u8,
1752 });
1753 }
1754 ::buffa::types::merge_string(&mut self.catalog_name, buf)?;
1755 }
1756 2u32 => {
1757 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1758 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1759 field_number: 2u32,
1760 expected: 2u8,
1761 actual: tag.wire_type() as u8,
1762 });
1763 }
1764 ::buffa::types::merge_string(&mut self.schema_name, buf)?;
1765 }
1766 3u32 => {
1767 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1768 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1769 field_number: 3u32,
1770 expected: 2u8,
1771 actual: tag.wire_type() as u8,
1772 });
1773 }
1774 ::buffa::types::merge_string(&mut self.name, buf)?;
1775 }
1776 4u32 => {
1777 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1778 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1779 field_number: 4u32,
1780 expected: 0u8,
1781 actual: tag.wire_type() as u8,
1782 });
1783 }
1784 self.invocation_protocol = ::buffa::EnumValue::from(
1785 ::buffa::types::decode_int32(buf)?,
1786 );
1787 }
1788 5u32 => {
1789 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1790 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1791 field_number: 5u32,
1792 expected: 2u8,
1793 actual: tag.wire_type() as u8,
1794 });
1795 }
1796 ::buffa::types::merge_string(&mut self.endpoint, buf)?;
1797 }
1798 6u32 => {
1799 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1800 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1801 field_number: 6u32,
1802 expected: 2u8,
1803 actual: tag.wire_type() as u8,
1804 });
1805 }
1806 ::buffa::types::merge_string(
1807 self
1808 .description
1809 .get_or_insert_with(::buffa::alloc::string::String::new),
1810 buf,
1811 )?;
1812 }
1813 7u32 => {
1814 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1815 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1816 field_number: 7u32,
1817 expected: 2u8,
1818 actual: tag.wire_type() as u8,
1819 });
1820 }
1821 self.capabilities.push(::buffa::types::decode_string(buf)?);
1822 }
1823 8u32 => {
1824 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1825 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1826 field_number: 8u32,
1827 expected: 2u8,
1828 actual: tag.wire_type() as u8,
1829 });
1830 }
1831 ::buffa::types::merge_string(
1832 self
1833 .input_schema
1834 .get_or_insert_with(::buffa::alloc::string::String::new),
1835 buf,
1836 )?;
1837 }
1838 9u32 => {
1839 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1840 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1841 field_number: 9u32,
1842 expected: 2u8,
1843 actual: tag.wire_type() as u8,
1844 });
1845 }
1846 ::buffa::types::merge_string(
1847 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
1848 buf,
1849 )?;
1850 }
1851 _ => {
1852 self.__buffa_unknown_fields
1853 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1854 }
1855 }
1856 ::core::result::Result::Ok(())
1857 }
1858 fn clear(&mut self) {
1859 self.catalog_name.clear();
1860 self.schema_name.clear();
1861 self.name.clear();
1862 self.invocation_protocol = ::buffa::EnumValue::from(0);
1863 self.endpoint.clear();
1864 self.description = ::core::option::Option::None;
1865 self.capabilities.clear();
1866 self.input_schema = ::core::option::Option::None;
1867 self.comment = ::core::option::Option::None;
1868 self.__buffa_unknown_fields.clear();
1869 }
1870}
1871impl ::buffa::ExtensionSet for CreateAgentRequest {
1872 const PROTO_FQN: &'static str = "unitycatalog.agents.v0alpha1.CreateAgentRequest";
1873 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1874 &self.__buffa_unknown_fields
1875 }
1876 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1877 &mut self.__buffa_unknown_fields
1878 }
1879}
1880impl ::buffa::json_helpers::ProtoElemJson for CreateAgentRequest {
1881 fn serialize_proto_json<S: ::serde::Serializer>(
1882 v: &Self,
1883 s: S,
1884 ) -> ::core::result::Result<S::Ok, S::Error> {
1885 ::serde::Serialize::serialize(v, s)
1886 }
1887 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1888 d: D,
1889 ) -> ::core::result::Result<Self, D::Error> {
1890 <Self as ::serde::Deserialize>::deserialize(d)
1891 }
1892}
1893#[doc(hidden)]
1894pub const __CREATE_AGENT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1895 type_url: "type.googleapis.com/unitycatalog.agents.v0alpha1.CreateAgentRequest",
1896 to_json: ::buffa::type_registry::any_to_json::<CreateAgentRequest>,
1897 from_json: ::buffa::type_registry::any_from_json::<CreateAgentRequest>,
1898 is_wkt: false,
1899};
1900#[derive(Clone, PartialEq, Default)]
1901#[derive(::serde::Serialize, ::serde::Deserialize)]
1902#[serde(default)]
1903pub struct GetAgentRequest {
1904 #[serde(
1908 rename = "name",
1909 with = "::buffa::json_helpers::proto_string",
1910 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1911 )]
1912 pub name: ::buffa::alloc::string::String,
1913 #[serde(
1918 rename = "include_browse",
1919 alias = "includeBrowse",
1920 skip_serializing_if = "::core::option::Option::is_none"
1921 )]
1922 pub include_browse: ::core::option::Option<bool>,
1923 #[serde(skip)]
1924 #[doc(hidden)]
1925 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1926}
1927impl ::core::fmt::Debug for GetAgentRequest {
1928 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1929 f.debug_struct("GetAgentRequest")
1930 .field("name", &self.name)
1931 .field("include_browse", &self.include_browse)
1932 .finish()
1933 }
1934}
1935impl GetAgentRequest {
1936 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.GetAgentRequest";
1941}
1942impl GetAgentRequest {
1943 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1944 #[inline]
1945 pub fn with_include_browse(mut self, value: bool) -> Self {
1947 self.include_browse = Some(value);
1948 self
1949 }
1950}
1951impl ::buffa::DefaultInstance for GetAgentRequest {
1952 fn default_instance() -> &'static Self {
1953 static VALUE: ::buffa::__private::OnceBox<GetAgentRequest> = ::buffa::__private::OnceBox::new();
1954 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1955 }
1956}
1957impl ::buffa::MessageName for GetAgentRequest {
1958 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
1959 const NAME: &'static str = "GetAgentRequest";
1960 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.GetAgentRequest";
1961 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.GetAgentRequest";
1962}
1963impl ::buffa::Message for GetAgentRequest {
1964 #[allow(clippy::let_and_return)]
1970 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1971 #[allow(unused_imports)]
1972 use ::buffa::Enumeration as _;
1973 let mut size = 0u32;
1974 if !self.name.is_empty() {
1975 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
1976 }
1977 if self.include_browse.is_some() {
1978 size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1979 }
1980 size += self.__buffa_unknown_fields.encoded_len() as u32;
1981 size
1982 }
1983 fn write_to(
1984 &self,
1985 _cache: &mut ::buffa::SizeCache,
1986 buf: &mut impl ::buffa::bytes::BufMut,
1987 ) {
1988 #[allow(unused_imports)]
1989 use ::buffa::Enumeration as _;
1990 if !self.name.is_empty() {
1991 ::buffa::encoding::Tag::new(
1992 1u32,
1993 ::buffa::encoding::WireType::LengthDelimited,
1994 )
1995 .encode(buf);
1996 ::buffa::types::encode_string(&self.name, buf);
1997 }
1998 if let Some(v) = self.include_browse {
1999 ::buffa::encoding::Tag::new(1005u32, ::buffa::encoding::WireType::Varint)
2000 .encode(buf);
2001 ::buffa::types::encode_bool(v, buf);
2002 }
2003 self.__buffa_unknown_fields.write_to(buf);
2004 }
2005 fn merge_field(
2006 &mut self,
2007 tag: ::buffa::encoding::Tag,
2008 buf: &mut impl ::buffa::bytes::Buf,
2009 depth: u32,
2010 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2011 #[allow(unused_imports)]
2012 use ::buffa::bytes::Buf as _;
2013 #[allow(unused_imports)]
2014 use ::buffa::Enumeration as _;
2015 match tag.field_number() {
2016 1u32 => {
2017 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2018 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2019 field_number: 1u32,
2020 expected: 2u8,
2021 actual: tag.wire_type() as u8,
2022 });
2023 }
2024 ::buffa::types::merge_string(&mut self.name, buf)?;
2025 }
2026 1005u32 => {
2027 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2028 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2029 field_number: 1005u32,
2030 expected: 0u8,
2031 actual: tag.wire_type() as u8,
2032 });
2033 }
2034 self.include_browse = ::core::option::Option::Some(
2035 ::buffa::types::decode_bool(buf)?,
2036 );
2037 }
2038 _ => {
2039 self.__buffa_unknown_fields
2040 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2041 }
2042 }
2043 ::core::result::Result::Ok(())
2044 }
2045 fn clear(&mut self) {
2046 self.name.clear();
2047 self.include_browse = ::core::option::Option::None;
2048 self.__buffa_unknown_fields.clear();
2049 }
2050}
2051impl ::buffa::ExtensionSet for GetAgentRequest {
2052 const PROTO_FQN: &'static str = "unitycatalog.agents.v0alpha1.GetAgentRequest";
2053 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2054 &self.__buffa_unknown_fields
2055 }
2056 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2057 &mut self.__buffa_unknown_fields
2058 }
2059}
2060impl ::buffa::json_helpers::ProtoElemJson for GetAgentRequest {
2061 fn serialize_proto_json<S: ::serde::Serializer>(
2062 v: &Self,
2063 s: S,
2064 ) -> ::core::result::Result<S::Ok, S::Error> {
2065 ::serde::Serialize::serialize(v, s)
2066 }
2067 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2068 d: D,
2069 ) -> ::core::result::Result<Self, D::Error> {
2070 <Self as ::serde::Deserialize>::deserialize(d)
2071 }
2072}
2073#[doc(hidden)]
2074pub const __GET_AGENT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2075 type_url: "type.googleapis.com/unitycatalog.agents.v0alpha1.GetAgentRequest",
2076 to_json: ::buffa::type_registry::any_to_json::<GetAgentRequest>,
2077 from_json: ::buffa::type_registry::any_from_json::<GetAgentRequest>,
2078 is_wkt: false,
2079};
2080#[derive(Clone, PartialEq, Default)]
2081#[derive(::serde::Serialize, ::serde::Deserialize)]
2082#[serde(default)]
2083pub struct UpdateAgentRequest {
2084 #[serde(
2088 rename = "name",
2089 with = "::buffa::json_helpers::proto_string",
2090 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2091 )]
2092 pub name: ::buffa::alloc::string::String,
2093 #[serde(
2097 rename = "new_name",
2098 alias = "newName",
2099 skip_serializing_if = "::core::option::Option::is_none"
2100 )]
2101 pub new_name: ::core::option::Option<::buffa::alloc::string::String>,
2102 #[serde(
2106 rename = "invocation_protocol",
2107 alias = "invocationProtocol",
2108 with = "::buffa::json_helpers::opt_enum",
2109 skip_serializing_if = "::core::option::Option::is_none"
2110 )]
2111 pub invocation_protocol: ::core::option::Option<
2112 ::buffa::EnumValue<InvocationProtocol>,
2113 >,
2114 #[serde(
2118 rename = "endpoint",
2119 skip_serializing_if = "::core::option::Option::is_none"
2120 )]
2121 pub endpoint: ::core::option::Option<::buffa::alloc::string::String>,
2122 #[serde(
2126 rename = "description",
2127 skip_serializing_if = "::core::option::Option::is_none"
2128 )]
2129 pub description: ::core::option::Option<::buffa::alloc::string::String>,
2130 #[serde(
2134 rename = "capabilities",
2135 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2136 deserialize_with = "::buffa::json_helpers::null_as_default"
2137 )]
2138 pub capabilities: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
2139 #[serde(
2143 rename = "input_schema",
2144 alias = "inputSchema",
2145 skip_serializing_if = "::core::option::Option::is_none"
2146 )]
2147 pub input_schema: ::core::option::Option<::buffa::alloc::string::String>,
2148 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
2152 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
2153 #[serde(rename = "owner", skip_serializing_if = "::core::option::Option::is_none")]
2157 pub owner: ::core::option::Option<::buffa::alloc::string::String>,
2158 #[serde(skip)]
2159 #[doc(hidden)]
2160 pub __buffa_unknown_fields: ::buffa::UnknownFields,
2161}
2162impl ::core::fmt::Debug for UpdateAgentRequest {
2163 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2164 f.debug_struct("UpdateAgentRequest")
2165 .field("name", &self.name)
2166 .field("new_name", &self.new_name)
2167 .field("invocation_protocol", &self.invocation_protocol)
2168 .field("endpoint", &self.endpoint)
2169 .field("description", &self.description)
2170 .field("capabilities", &self.capabilities)
2171 .field("input_schema", &self.input_schema)
2172 .field("comment", &self.comment)
2173 .field("owner", &self.owner)
2174 .finish()
2175 }
2176}
2177impl UpdateAgentRequest {
2178 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.UpdateAgentRequest";
2183}
2184impl UpdateAgentRequest {
2185 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2186 #[inline]
2187 pub fn with_new_name(
2189 mut self,
2190 value: impl Into<::buffa::alloc::string::String>,
2191 ) -> Self {
2192 self.new_name = Some(value.into());
2193 self
2194 }
2195 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2196 #[inline]
2197 pub fn with_invocation_protocol(
2199 mut self,
2200 value: impl Into<::buffa::EnumValue<InvocationProtocol>>,
2201 ) -> Self {
2202 self.invocation_protocol = Some(value.into());
2203 self
2204 }
2205 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2206 #[inline]
2207 pub fn with_endpoint(
2209 mut self,
2210 value: impl Into<::buffa::alloc::string::String>,
2211 ) -> Self {
2212 self.endpoint = Some(value.into());
2213 self
2214 }
2215 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2216 #[inline]
2217 pub fn with_description(
2219 mut self,
2220 value: impl Into<::buffa::alloc::string::String>,
2221 ) -> Self {
2222 self.description = Some(value.into());
2223 self
2224 }
2225 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2226 #[inline]
2227 pub fn with_input_schema(
2229 mut self,
2230 value: impl Into<::buffa::alloc::string::String>,
2231 ) -> Self {
2232 self.input_schema = Some(value.into());
2233 self
2234 }
2235 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2236 #[inline]
2237 pub fn with_comment(
2239 mut self,
2240 value: impl Into<::buffa::alloc::string::String>,
2241 ) -> Self {
2242 self.comment = Some(value.into());
2243 self
2244 }
2245 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2246 #[inline]
2247 pub fn with_owner(
2249 mut self,
2250 value: impl Into<::buffa::alloc::string::String>,
2251 ) -> Self {
2252 self.owner = Some(value.into());
2253 self
2254 }
2255}
2256impl ::buffa::DefaultInstance for UpdateAgentRequest {
2257 fn default_instance() -> &'static Self {
2258 static VALUE: ::buffa::__private::OnceBox<UpdateAgentRequest> = ::buffa::__private::OnceBox::new();
2259 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2260 }
2261}
2262impl ::buffa::MessageName for UpdateAgentRequest {
2263 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
2264 const NAME: &'static str = "UpdateAgentRequest";
2265 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.UpdateAgentRequest";
2266 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.UpdateAgentRequest";
2267}
2268impl ::buffa::Message for UpdateAgentRequest {
2269 #[allow(clippy::let_and_return)]
2275 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2276 #[allow(unused_imports)]
2277 use ::buffa::Enumeration as _;
2278 let mut size = 0u32;
2279 if !self.name.is_empty() {
2280 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
2281 }
2282 if let Some(ref v) = self.new_name {
2283 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2284 }
2285 if let Some(ref v) = self.invocation_protocol {
2286 size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
2287 }
2288 if let Some(ref v) = self.endpoint {
2289 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2290 }
2291 if let Some(ref v) = self.description {
2292 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2293 }
2294 for v in &self.capabilities {
2295 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2296 }
2297 if let Some(ref v) = self.input_schema {
2298 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2299 }
2300 if let Some(ref v) = self.comment {
2301 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2302 }
2303 if let Some(ref v) = self.owner {
2304 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2305 }
2306 size += self.__buffa_unknown_fields.encoded_len() as u32;
2307 size
2308 }
2309 fn write_to(
2310 &self,
2311 _cache: &mut ::buffa::SizeCache,
2312 buf: &mut impl ::buffa::bytes::BufMut,
2313 ) {
2314 #[allow(unused_imports)]
2315 use ::buffa::Enumeration as _;
2316 if !self.name.is_empty() {
2317 ::buffa::encoding::Tag::new(
2318 1u32,
2319 ::buffa::encoding::WireType::LengthDelimited,
2320 )
2321 .encode(buf);
2322 ::buffa::types::encode_string(&self.name, buf);
2323 }
2324 if let Some(ref v) = self.new_name {
2325 ::buffa::encoding::Tag::new(
2326 2u32,
2327 ::buffa::encoding::WireType::LengthDelimited,
2328 )
2329 .encode(buf);
2330 ::buffa::types::encode_string(v, buf);
2331 }
2332 if let Some(ref v) = self.invocation_protocol {
2333 ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
2334 .encode(buf);
2335 ::buffa::types::encode_int32(v.to_i32(), buf);
2336 }
2337 if let Some(ref v) = self.endpoint {
2338 ::buffa::encoding::Tag::new(
2339 4u32,
2340 ::buffa::encoding::WireType::LengthDelimited,
2341 )
2342 .encode(buf);
2343 ::buffa::types::encode_string(v, buf);
2344 }
2345 if let Some(ref v) = self.description {
2346 ::buffa::encoding::Tag::new(
2347 5u32,
2348 ::buffa::encoding::WireType::LengthDelimited,
2349 )
2350 .encode(buf);
2351 ::buffa::types::encode_string(v, buf);
2352 }
2353 for v in &self.capabilities {
2354 ::buffa::encoding::Tag::new(
2355 6u32,
2356 ::buffa::encoding::WireType::LengthDelimited,
2357 )
2358 .encode(buf);
2359 ::buffa::types::encode_string(v, buf);
2360 }
2361 if let Some(ref v) = self.input_schema {
2362 ::buffa::encoding::Tag::new(
2363 7u32,
2364 ::buffa::encoding::WireType::LengthDelimited,
2365 )
2366 .encode(buf);
2367 ::buffa::types::encode_string(v, buf);
2368 }
2369 if let Some(ref v) = self.comment {
2370 ::buffa::encoding::Tag::new(
2371 8u32,
2372 ::buffa::encoding::WireType::LengthDelimited,
2373 )
2374 .encode(buf);
2375 ::buffa::types::encode_string(v, buf);
2376 }
2377 if let Some(ref v) = self.owner {
2378 ::buffa::encoding::Tag::new(
2379 9u32,
2380 ::buffa::encoding::WireType::LengthDelimited,
2381 )
2382 .encode(buf);
2383 ::buffa::types::encode_string(v, buf);
2384 }
2385 self.__buffa_unknown_fields.write_to(buf);
2386 }
2387 fn merge_field(
2388 &mut self,
2389 tag: ::buffa::encoding::Tag,
2390 buf: &mut impl ::buffa::bytes::Buf,
2391 depth: u32,
2392 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2393 #[allow(unused_imports)]
2394 use ::buffa::bytes::Buf as _;
2395 #[allow(unused_imports)]
2396 use ::buffa::Enumeration as _;
2397 match tag.field_number() {
2398 1u32 => {
2399 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2400 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2401 field_number: 1u32,
2402 expected: 2u8,
2403 actual: tag.wire_type() as u8,
2404 });
2405 }
2406 ::buffa::types::merge_string(&mut self.name, buf)?;
2407 }
2408 2u32 => {
2409 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2410 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2411 field_number: 2u32,
2412 expected: 2u8,
2413 actual: tag.wire_type() as u8,
2414 });
2415 }
2416 ::buffa::types::merge_string(
2417 self
2418 .new_name
2419 .get_or_insert_with(::buffa::alloc::string::String::new),
2420 buf,
2421 )?;
2422 }
2423 3u32 => {
2424 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2425 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2426 field_number: 3u32,
2427 expected: 0u8,
2428 actual: tag.wire_type() as u8,
2429 });
2430 }
2431 self.invocation_protocol = ::core::option::Option::Some(
2432 ::buffa::EnumValue::from(::buffa::types::decode_int32(buf)?),
2433 );
2434 }
2435 4u32 => {
2436 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2437 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2438 field_number: 4u32,
2439 expected: 2u8,
2440 actual: tag.wire_type() as u8,
2441 });
2442 }
2443 ::buffa::types::merge_string(
2444 self
2445 .endpoint
2446 .get_or_insert_with(::buffa::alloc::string::String::new),
2447 buf,
2448 )?;
2449 }
2450 5u32 => {
2451 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2452 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2453 field_number: 5u32,
2454 expected: 2u8,
2455 actual: tag.wire_type() as u8,
2456 });
2457 }
2458 ::buffa::types::merge_string(
2459 self
2460 .description
2461 .get_or_insert_with(::buffa::alloc::string::String::new),
2462 buf,
2463 )?;
2464 }
2465 6u32 => {
2466 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2467 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2468 field_number: 6u32,
2469 expected: 2u8,
2470 actual: tag.wire_type() as u8,
2471 });
2472 }
2473 self.capabilities.push(::buffa::types::decode_string(buf)?);
2474 }
2475 7u32 => {
2476 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2477 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2478 field_number: 7u32,
2479 expected: 2u8,
2480 actual: tag.wire_type() as u8,
2481 });
2482 }
2483 ::buffa::types::merge_string(
2484 self
2485 .input_schema
2486 .get_or_insert_with(::buffa::alloc::string::String::new),
2487 buf,
2488 )?;
2489 }
2490 8u32 => {
2491 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2492 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2493 field_number: 8u32,
2494 expected: 2u8,
2495 actual: tag.wire_type() as u8,
2496 });
2497 }
2498 ::buffa::types::merge_string(
2499 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
2500 buf,
2501 )?;
2502 }
2503 9u32 => {
2504 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2505 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2506 field_number: 9u32,
2507 expected: 2u8,
2508 actual: tag.wire_type() as u8,
2509 });
2510 }
2511 ::buffa::types::merge_string(
2512 self.owner.get_or_insert_with(::buffa::alloc::string::String::new),
2513 buf,
2514 )?;
2515 }
2516 _ => {
2517 self.__buffa_unknown_fields
2518 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2519 }
2520 }
2521 ::core::result::Result::Ok(())
2522 }
2523 fn clear(&mut self) {
2524 self.name.clear();
2525 self.new_name = ::core::option::Option::None;
2526 self.invocation_protocol = ::core::option::Option::None;
2527 self.endpoint = ::core::option::Option::None;
2528 self.description = ::core::option::Option::None;
2529 self.capabilities.clear();
2530 self.input_schema = ::core::option::Option::None;
2531 self.comment = ::core::option::Option::None;
2532 self.owner = ::core::option::Option::None;
2533 self.__buffa_unknown_fields.clear();
2534 }
2535}
2536impl ::buffa::ExtensionSet for UpdateAgentRequest {
2537 const PROTO_FQN: &'static str = "unitycatalog.agents.v0alpha1.UpdateAgentRequest";
2538 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2539 &self.__buffa_unknown_fields
2540 }
2541 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2542 &mut self.__buffa_unknown_fields
2543 }
2544}
2545impl ::buffa::json_helpers::ProtoElemJson for UpdateAgentRequest {
2546 fn serialize_proto_json<S: ::serde::Serializer>(
2547 v: &Self,
2548 s: S,
2549 ) -> ::core::result::Result<S::Ok, S::Error> {
2550 ::serde::Serialize::serialize(v, s)
2551 }
2552 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2553 d: D,
2554 ) -> ::core::result::Result<Self, D::Error> {
2555 <Self as ::serde::Deserialize>::deserialize(d)
2556 }
2557}
2558#[doc(hidden)]
2559pub const __UPDATE_AGENT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2560 type_url: "type.googleapis.com/unitycatalog.agents.v0alpha1.UpdateAgentRequest",
2561 to_json: ::buffa::type_registry::any_to_json::<UpdateAgentRequest>,
2562 from_json: ::buffa::type_registry::any_from_json::<UpdateAgentRequest>,
2563 is_wkt: false,
2564};
2565#[derive(Clone, PartialEq, Default)]
2566#[derive(::serde::Serialize, ::serde::Deserialize)]
2567#[serde(default)]
2568pub struct DeleteAgentRequest {
2569 #[serde(
2573 rename = "name",
2574 with = "::buffa::json_helpers::proto_string",
2575 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2576 )]
2577 pub name: ::buffa::alloc::string::String,
2578 #[serde(skip)]
2579 #[doc(hidden)]
2580 pub __buffa_unknown_fields: ::buffa::UnknownFields,
2581}
2582impl ::core::fmt::Debug for DeleteAgentRequest {
2583 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2584 f.debug_struct("DeleteAgentRequest").field("name", &self.name).finish()
2585 }
2586}
2587impl DeleteAgentRequest {
2588 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.DeleteAgentRequest";
2593}
2594impl ::buffa::DefaultInstance for DeleteAgentRequest {
2595 fn default_instance() -> &'static Self {
2596 static VALUE: ::buffa::__private::OnceBox<DeleteAgentRequest> = ::buffa::__private::OnceBox::new();
2597 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2598 }
2599}
2600impl ::buffa::MessageName for DeleteAgentRequest {
2601 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
2602 const NAME: &'static str = "DeleteAgentRequest";
2603 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.DeleteAgentRequest";
2604 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.DeleteAgentRequest";
2605}
2606impl ::buffa::Message for DeleteAgentRequest {
2607 #[allow(clippy::let_and_return)]
2613 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2614 #[allow(unused_imports)]
2615 use ::buffa::Enumeration as _;
2616 let mut size = 0u32;
2617 if !self.name.is_empty() {
2618 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
2619 }
2620 size += self.__buffa_unknown_fields.encoded_len() as u32;
2621 size
2622 }
2623 fn write_to(
2624 &self,
2625 _cache: &mut ::buffa::SizeCache,
2626 buf: &mut impl ::buffa::bytes::BufMut,
2627 ) {
2628 #[allow(unused_imports)]
2629 use ::buffa::Enumeration as _;
2630 if !self.name.is_empty() {
2631 ::buffa::encoding::Tag::new(
2632 1u32,
2633 ::buffa::encoding::WireType::LengthDelimited,
2634 )
2635 .encode(buf);
2636 ::buffa::types::encode_string(&self.name, buf);
2637 }
2638 self.__buffa_unknown_fields.write_to(buf);
2639 }
2640 fn merge_field(
2641 &mut self,
2642 tag: ::buffa::encoding::Tag,
2643 buf: &mut impl ::buffa::bytes::Buf,
2644 depth: u32,
2645 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2646 #[allow(unused_imports)]
2647 use ::buffa::bytes::Buf as _;
2648 #[allow(unused_imports)]
2649 use ::buffa::Enumeration as _;
2650 match tag.field_number() {
2651 1u32 => {
2652 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2653 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2654 field_number: 1u32,
2655 expected: 2u8,
2656 actual: tag.wire_type() as u8,
2657 });
2658 }
2659 ::buffa::types::merge_string(&mut self.name, buf)?;
2660 }
2661 _ => {
2662 self.__buffa_unknown_fields
2663 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2664 }
2665 }
2666 ::core::result::Result::Ok(())
2667 }
2668 fn clear(&mut self) {
2669 self.name.clear();
2670 self.__buffa_unknown_fields.clear();
2671 }
2672}
2673impl ::buffa::ExtensionSet for DeleteAgentRequest {
2674 const PROTO_FQN: &'static str = "unitycatalog.agents.v0alpha1.DeleteAgentRequest";
2675 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2676 &self.__buffa_unknown_fields
2677 }
2678 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2679 &mut self.__buffa_unknown_fields
2680 }
2681}
2682impl ::buffa::json_helpers::ProtoElemJson for DeleteAgentRequest {
2683 fn serialize_proto_json<S: ::serde::Serializer>(
2684 v: &Self,
2685 s: S,
2686 ) -> ::core::result::Result<S::Ok, S::Error> {
2687 ::serde::Serialize::serialize(v, s)
2688 }
2689 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2690 d: D,
2691 ) -> ::core::result::Result<Self, D::Error> {
2692 <Self as ::serde::Deserialize>::deserialize(d)
2693 }
2694}
2695#[doc(hidden)]
2696pub const __DELETE_AGENT_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2697 type_url: "type.googleapis.com/unitycatalog.agents.v0alpha1.DeleteAgentRequest",
2698 to_json: ::buffa::type_registry::any_to_json::<DeleteAgentRequest>,
2699 from_json: ::buffa::type_registry::any_from_json::<DeleteAgentRequest>,
2700 is_wkt: false,
2701};
2702#[allow(
2703 non_camel_case_types,
2704 dead_code,
2705 unused_imports,
2706 unused_qualifications,
2707 clippy::derivable_impls,
2708 clippy::match_single_binding,
2709 clippy::uninlined_format_args,
2710 clippy::doc_lazy_continuation,
2711 clippy::module_inception
2712)]
2713pub mod __buffa {
2714 #[allow(unused_imports)]
2715 use super::*;
2716 pub mod view {
2717 #[allow(unused_imports)]
2718 use super::*;
2719 #[derive(Clone, Debug, Default)]
2721 pub struct AgentView<'a> {
2722 pub name: &'a str,
2726 pub catalog_name: &'a str,
2730 pub schema_name: &'a str,
2734 pub full_name: &'a str,
2738 pub agent_id: &'a str,
2742 pub invocation_protocol: ::buffa::EnumValue<
2746 super::super::InvocationProtocol,
2747 >,
2748 pub endpoint: &'a str,
2752 pub description: ::core::option::Option<&'a str>,
2757 pub capabilities: ::buffa::RepeatedView<'a, &'a str>,
2762 pub input_schema: ::core::option::Option<&'a str>,
2768 pub owner: ::core::option::Option<&'a str>,
2772 pub comment: ::core::option::Option<&'a str>,
2776 pub created_at: ::core::option::Option<i64>,
2780 pub created_by: ::core::option::Option<&'a str>,
2784 pub updated_at: ::core::option::Option<i64>,
2788 pub updated_by: ::core::option::Option<&'a str>,
2792 pub metastore_id: ::core::option::Option<&'a str>,
2796 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2797 }
2798 impl<'a> AgentView<'a> {
2799 #[doc(hidden)]
2807 pub fn _decode_depth(
2808 buf: &'a [u8],
2809 depth: u32,
2810 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2811 let mut view = Self::default();
2812 view._merge_into_view(buf, depth)?;
2813 ::core::result::Result::Ok(view)
2814 }
2815 #[doc(hidden)]
2823 pub fn _merge_into_view(
2824 &mut self,
2825 buf: &'a [u8],
2826 depth: u32,
2827 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2828 let _ = depth;
2829 #[allow(unused_variables)]
2830 let view = self;
2831 let mut cur: &'a [u8] = buf;
2832 while !cur.is_empty() {
2833 let before_tag = cur;
2834 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
2835 match tag.field_number() {
2836 1u32 => {
2837 if tag.wire_type()
2838 != ::buffa::encoding::WireType::LengthDelimited
2839 {
2840 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2841 field_number: 1u32,
2842 expected: 2u8,
2843 actual: tag.wire_type() as u8,
2844 });
2845 }
2846 view.name = ::buffa::types::borrow_str(&mut cur)?;
2847 }
2848 2u32 => {
2849 if tag.wire_type()
2850 != ::buffa::encoding::WireType::LengthDelimited
2851 {
2852 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2853 field_number: 2u32,
2854 expected: 2u8,
2855 actual: tag.wire_type() as u8,
2856 });
2857 }
2858 view.catalog_name = ::buffa::types::borrow_str(&mut cur)?;
2859 }
2860 3u32 => {
2861 if tag.wire_type()
2862 != ::buffa::encoding::WireType::LengthDelimited
2863 {
2864 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2865 field_number: 3u32,
2866 expected: 2u8,
2867 actual: tag.wire_type() as u8,
2868 });
2869 }
2870 view.schema_name = ::buffa::types::borrow_str(&mut cur)?;
2871 }
2872 4u32 => {
2873 if tag.wire_type()
2874 != ::buffa::encoding::WireType::LengthDelimited
2875 {
2876 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2877 field_number: 4u32,
2878 expected: 2u8,
2879 actual: tag.wire_type() as u8,
2880 });
2881 }
2882 view.full_name = ::buffa::types::borrow_str(&mut cur)?;
2883 }
2884 5u32 => {
2885 if tag.wire_type()
2886 != ::buffa::encoding::WireType::LengthDelimited
2887 {
2888 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2889 field_number: 5u32,
2890 expected: 2u8,
2891 actual: tag.wire_type() as u8,
2892 });
2893 }
2894 view.agent_id = ::buffa::types::borrow_str(&mut cur)?;
2895 }
2896 6u32 => {
2897 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2898 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2899 field_number: 6u32,
2900 expected: 0u8,
2901 actual: tag.wire_type() as u8,
2902 });
2903 }
2904 view.invocation_protocol = ::buffa::EnumValue::from(
2905 ::buffa::types::decode_int32(&mut cur)?,
2906 );
2907 }
2908 7u32 => {
2909 if tag.wire_type()
2910 != ::buffa::encoding::WireType::LengthDelimited
2911 {
2912 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2913 field_number: 7u32,
2914 expected: 2u8,
2915 actual: tag.wire_type() as u8,
2916 });
2917 }
2918 view.endpoint = ::buffa::types::borrow_str(&mut cur)?;
2919 }
2920 8u32 => {
2921 if tag.wire_type()
2922 != ::buffa::encoding::WireType::LengthDelimited
2923 {
2924 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2925 field_number: 8u32,
2926 expected: 2u8,
2927 actual: tag.wire_type() as u8,
2928 });
2929 }
2930 view.description = Some(
2931 ::buffa::types::borrow_str(&mut cur)?,
2932 );
2933 }
2934 10u32 => {
2935 if tag.wire_type()
2936 != ::buffa::encoding::WireType::LengthDelimited
2937 {
2938 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2939 field_number: 10u32,
2940 expected: 2u8,
2941 actual: tag.wire_type() as u8,
2942 });
2943 }
2944 view.input_schema = Some(
2945 ::buffa::types::borrow_str(&mut cur)?,
2946 );
2947 }
2948 11u32 => {
2949 if tag.wire_type()
2950 != ::buffa::encoding::WireType::LengthDelimited
2951 {
2952 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2953 field_number: 11u32,
2954 expected: 2u8,
2955 actual: tag.wire_type() as u8,
2956 });
2957 }
2958 view.owner = Some(::buffa::types::borrow_str(&mut cur)?);
2959 }
2960 12u32 => {
2961 if tag.wire_type()
2962 != ::buffa::encoding::WireType::LengthDelimited
2963 {
2964 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2965 field_number: 12u32,
2966 expected: 2u8,
2967 actual: tag.wire_type() as u8,
2968 });
2969 }
2970 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
2971 }
2972 1000u32 => {
2973 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2974 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2975 field_number: 1000u32,
2976 expected: 0u8,
2977 actual: tag.wire_type() as u8,
2978 });
2979 }
2980 view.created_at = Some(
2981 ::buffa::types::decode_int64(&mut cur)?,
2982 );
2983 }
2984 1001u32 => {
2985 if tag.wire_type()
2986 != ::buffa::encoding::WireType::LengthDelimited
2987 {
2988 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2989 field_number: 1001u32,
2990 expected: 2u8,
2991 actual: tag.wire_type() as u8,
2992 });
2993 }
2994 view.created_by = Some(
2995 ::buffa::types::borrow_str(&mut cur)?,
2996 );
2997 }
2998 1002u32 => {
2999 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3000 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3001 field_number: 1002u32,
3002 expected: 0u8,
3003 actual: tag.wire_type() as u8,
3004 });
3005 }
3006 view.updated_at = Some(
3007 ::buffa::types::decode_int64(&mut cur)?,
3008 );
3009 }
3010 1003u32 => {
3011 if tag.wire_type()
3012 != ::buffa::encoding::WireType::LengthDelimited
3013 {
3014 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3015 field_number: 1003u32,
3016 expected: 2u8,
3017 actual: tag.wire_type() as u8,
3018 });
3019 }
3020 view.updated_by = Some(
3021 ::buffa::types::borrow_str(&mut cur)?,
3022 );
3023 }
3024 1004u32 => {
3025 if tag.wire_type()
3026 != ::buffa::encoding::WireType::LengthDelimited
3027 {
3028 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3029 field_number: 1004u32,
3030 expected: 2u8,
3031 actual: tag.wire_type() as u8,
3032 });
3033 }
3034 view.metastore_id = Some(
3035 ::buffa::types::borrow_str(&mut cur)?,
3036 );
3037 }
3038 9u32 => {
3039 if tag.wire_type()
3040 != ::buffa::encoding::WireType::LengthDelimited
3041 {
3042 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3043 field_number: 9u32,
3044 expected: 2u8,
3045 actual: tag.wire_type() as u8,
3046 });
3047 }
3048 view.capabilities
3049 .push(::buffa::types::borrow_str(&mut cur)?);
3050 }
3051 _ => {
3052 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
3053 let span_len = before_tag.len() - cur.len();
3054 view.__buffa_unknown_fields
3055 .push_raw(&before_tag[..span_len]);
3056 }
3057 }
3058 }
3059 ::core::result::Result::Ok(())
3060 }
3061 }
3062 impl<'a> ::buffa::MessageView<'a> for AgentView<'a> {
3063 type Owned = super::super::Agent;
3064 fn decode_view(
3065 buf: &'a [u8],
3066 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3067 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
3068 }
3069 fn decode_view_with_limit(
3070 buf: &'a [u8],
3071 depth: u32,
3072 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3073 Self::_decode_depth(buf, depth)
3074 }
3075 fn to_owned_message(&self) -> super::super::Agent {
3076 self.to_owned_from_source(None)
3077 }
3078 #[allow(clippy::useless_conversion, clippy::needless_update)]
3079 fn to_owned_from_source(
3080 &self,
3081 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3082 ) -> super::super::Agent {
3083 #[allow(unused_imports)]
3084 use ::buffa::alloc::string::ToString as _;
3085 let _ = __buffa_src;
3086 super::super::Agent {
3087 name: self.name.to_string(),
3088 catalog_name: self.catalog_name.to_string(),
3089 schema_name: self.schema_name.to_string(),
3090 full_name: self.full_name.to_string(),
3091 agent_id: self.agent_id.to_string(),
3092 invocation_protocol: self.invocation_protocol,
3093 endpoint: self.endpoint.to_string(),
3094 description: self.description.map(|s| s.to_string()),
3095 capabilities: self
3096 .capabilities
3097 .iter()
3098 .map(|s| s.to_string())
3099 .collect(),
3100 input_schema: self.input_schema.map(|s| s.to_string()),
3101 owner: self.owner.map(|s| s.to_string()),
3102 comment: self.comment.map(|s| s.to_string()),
3103 created_at: self.created_at,
3104 created_by: self.created_by.map(|s| s.to_string()),
3105 updated_at: self.updated_at,
3106 updated_by: self.updated_by.map(|s| s.to_string()),
3107 metastore_id: self.metastore_id.map(|s| s.to_string()),
3108 __buffa_unknown_fields: self
3109 .__buffa_unknown_fields
3110 .to_owned()
3111 .unwrap_or_default()
3112 .into(),
3113 ..::core::default::Default::default()
3114 }
3115 }
3116 }
3117 impl<'a> ::buffa::ViewEncode<'a> for AgentView<'a> {
3118 #[allow(clippy::needless_borrow, clippy::let_and_return)]
3119 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3120 #[allow(unused_imports)]
3121 use ::buffa::Enumeration as _;
3122 let mut size = 0u32;
3123 if !self.name.is_empty() {
3124 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
3125 }
3126 if !self.catalog_name.is_empty() {
3127 size
3128 += 1u32
3129 + ::buffa::types::string_encoded_len(&self.catalog_name)
3130 as u32;
3131 }
3132 if !self.schema_name.is_empty() {
3133 size
3134 += 1u32
3135 + ::buffa::types::string_encoded_len(&self.schema_name)
3136 as u32;
3137 }
3138 if !self.full_name.is_empty() {
3139 size
3140 += 1u32
3141 + ::buffa::types::string_encoded_len(&self.full_name) as u32;
3142 }
3143 if !self.agent_id.is_empty() {
3144 size
3145 += 1u32
3146 + ::buffa::types::string_encoded_len(&self.agent_id) as u32;
3147 }
3148 {
3149 let val = self.invocation_protocol.to_i32();
3150 if val != 0 {
3151 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
3152 }
3153 }
3154 if !self.endpoint.is_empty() {
3155 size
3156 += 1u32
3157 + ::buffa::types::string_encoded_len(&self.endpoint) as u32;
3158 }
3159 if let Some(ref v) = self.description {
3160 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3161 }
3162 for v in &self.capabilities {
3163 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3164 }
3165 if let Some(ref v) = self.input_schema {
3166 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3167 }
3168 if let Some(ref v) = self.owner {
3169 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3170 }
3171 if let Some(ref v) = self.comment {
3172 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3173 }
3174 if let Some(v) = self.created_at {
3175 size += 2u32 + ::buffa::types::int64_encoded_len(v) as u32;
3176 }
3177 if let Some(ref v) = self.created_by {
3178 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
3179 }
3180 if let Some(v) = self.updated_at {
3181 size += 2u32 + ::buffa::types::int64_encoded_len(v) as u32;
3182 }
3183 if let Some(ref v) = self.updated_by {
3184 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
3185 }
3186 if let Some(ref v) = self.metastore_id {
3187 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
3188 }
3189 size += self.__buffa_unknown_fields.encoded_len() as u32;
3190 size
3191 }
3192 #[allow(clippy::needless_borrow)]
3193 fn write_to(
3194 &self,
3195 _cache: &mut ::buffa::SizeCache,
3196 buf: &mut impl ::buffa::bytes::BufMut,
3197 ) {
3198 #[allow(unused_imports)]
3199 use ::buffa::Enumeration as _;
3200 if !self.name.is_empty() {
3201 ::buffa::encoding::Tag::new(
3202 1u32,
3203 ::buffa::encoding::WireType::LengthDelimited,
3204 )
3205 .encode(buf);
3206 ::buffa::types::encode_string(&self.name, buf);
3207 }
3208 if !self.catalog_name.is_empty() {
3209 ::buffa::encoding::Tag::new(
3210 2u32,
3211 ::buffa::encoding::WireType::LengthDelimited,
3212 )
3213 .encode(buf);
3214 ::buffa::types::encode_string(&self.catalog_name, buf);
3215 }
3216 if !self.schema_name.is_empty() {
3217 ::buffa::encoding::Tag::new(
3218 3u32,
3219 ::buffa::encoding::WireType::LengthDelimited,
3220 )
3221 .encode(buf);
3222 ::buffa::types::encode_string(&self.schema_name, buf);
3223 }
3224 if !self.full_name.is_empty() {
3225 ::buffa::encoding::Tag::new(
3226 4u32,
3227 ::buffa::encoding::WireType::LengthDelimited,
3228 )
3229 .encode(buf);
3230 ::buffa::types::encode_string(&self.full_name, buf);
3231 }
3232 if !self.agent_id.is_empty() {
3233 ::buffa::encoding::Tag::new(
3234 5u32,
3235 ::buffa::encoding::WireType::LengthDelimited,
3236 )
3237 .encode(buf);
3238 ::buffa::types::encode_string(&self.agent_id, buf);
3239 }
3240 {
3241 let val = self.invocation_protocol.to_i32();
3242 if val != 0 {
3243 ::buffa::encoding::Tag::new(
3244 6u32,
3245 ::buffa::encoding::WireType::Varint,
3246 )
3247 .encode(buf);
3248 ::buffa::types::encode_int32(val, buf);
3249 }
3250 }
3251 if !self.endpoint.is_empty() {
3252 ::buffa::encoding::Tag::new(
3253 7u32,
3254 ::buffa::encoding::WireType::LengthDelimited,
3255 )
3256 .encode(buf);
3257 ::buffa::types::encode_string(&self.endpoint, buf);
3258 }
3259 if let Some(ref v) = self.description {
3260 ::buffa::encoding::Tag::new(
3261 8u32,
3262 ::buffa::encoding::WireType::LengthDelimited,
3263 )
3264 .encode(buf);
3265 ::buffa::types::encode_string(v, buf);
3266 }
3267 for v in &self.capabilities {
3268 ::buffa::encoding::Tag::new(
3269 9u32,
3270 ::buffa::encoding::WireType::LengthDelimited,
3271 )
3272 .encode(buf);
3273 ::buffa::types::encode_string(v, buf);
3274 }
3275 if let Some(ref v) = self.input_schema {
3276 ::buffa::encoding::Tag::new(
3277 10u32,
3278 ::buffa::encoding::WireType::LengthDelimited,
3279 )
3280 .encode(buf);
3281 ::buffa::types::encode_string(v, buf);
3282 }
3283 if let Some(ref v) = self.owner {
3284 ::buffa::encoding::Tag::new(
3285 11u32,
3286 ::buffa::encoding::WireType::LengthDelimited,
3287 )
3288 .encode(buf);
3289 ::buffa::types::encode_string(v, buf);
3290 }
3291 if let Some(ref v) = self.comment {
3292 ::buffa::encoding::Tag::new(
3293 12u32,
3294 ::buffa::encoding::WireType::LengthDelimited,
3295 )
3296 .encode(buf);
3297 ::buffa::types::encode_string(v, buf);
3298 }
3299 if let Some(v) = self.created_at {
3300 ::buffa::encoding::Tag::new(
3301 1000u32,
3302 ::buffa::encoding::WireType::Varint,
3303 )
3304 .encode(buf);
3305 ::buffa::types::encode_int64(v, buf);
3306 }
3307 if let Some(ref v) = self.created_by {
3308 ::buffa::encoding::Tag::new(
3309 1001u32,
3310 ::buffa::encoding::WireType::LengthDelimited,
3311 )
3312 .encode(buf);
3313 ::buffa::types::encode_string(v, buf);
3314 }
3315 if let Some(v) = self.updated_at {
3316 ::buffa::encoding::Tag::new(
3317 1002u32,
3318 ::buffa::encoding::WireType::Varint,
3319 )
3320 .encode(buf);
3321 ::buffa::types::encode_int64(v, buf);
3322 }
3323 if let Some(ref v) = self.updated_by {
3324 ::buffa::encoding::Tag::new(
3325 1003u32,
3326 ::buffa::encoding::WireType::LengthDelimited,
3327 )
3328 .encode(buf);
3329 ::buffa::types::encode_string(v, buf);
3330 }
3331 if let Some(ref v) = self.metastore_id {
3332 ::buffa::encoding::Tag::new(
3333 1004u32,
3334 ::buffa::encoding::WireType::LengthDelimited,
3335 )
3336 .encode(buf);
3337 ::buffa::types::encode_string(v, buf);
3338 }
3339 self.__buffa_unknown_fields.write_to(buf);
3340 }
3341 }
3342 impl<'__a> ::serde::Serialize for AgentView<'__a> {
3354 fn serialize<__S: ::serde::Serializer>(
3355 &self,
3356 __s: __S,
3357 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3358 use ::serde::ser::SerializeMap as _;
3359 let mut __map = __s.serialize_map(::core::option::Option::None)?;
3360 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
3361 __map.serialize_entry("name", self.name)?;
3362 }
3363 if !::buffa::json_helpers::skip_if::is_empty_str(self.catalog_name) {
3364 __map.serialize_entry("catalog_name", self.catalog_name)?;
3365 }
3366 if !::buffa::json_helpers::skip_if::is_empty_str(self.schema_name) {
3367 __map.serialize_entry("schema_name", self.schema_name)?;
3368 }
3369 if !::buffa::json_helpers::skip_if::is_empty_str(self.full_name) {
3370 __map.serialize_entry("full_name", self.full_name)?;
3371 }
3372 if !::buffa::json_helpers::skip_if::is_empty_str(self.agent_id) {
3373 __map.serialize_entry("agent_id", self.agent_id)?;
3374 }
3375 if !::buffa::json_helpers::skip_if::is_default_enum_value(
3376 &self.invocation_protocol,
3377 ) {
3378 __map
3379 .serialize_entry(
3380 "invocationProtocol",
3381 &self.invocation_protocol,
3382 )?;
3383 }
3384 if !::buffa::json_helpers::skip_if::is_empty_str(self.endpoint) {
3385 __map.serialize_entry("endpoint", self.endpoint)?;
3386 }
3387 if let ::core::option::Option::Some(__v) = self.description {
3388 __map.serialize_entry("description", __v)?;
3389 }
3390 if !self.capabilities.is_empty() {
3391 __map.serialize_entry("capabilities", &*self.capabilities)?;
3392 }
3393 if let ::core::option::Option::Some(__v) = self.input_schema {
3394 __map.serialize_entry("input_schema", __v)?;
3395 }
3396 if let ::core::option::Option::Some(__v) = self.owner {
3397 __map.serialize_entry("owner", __v)?;
3398 }
3399 if let ::core::option::Option::Some(__v) = self.comment {
3400 __map.serialize_entry("comment", __v)?;
3401 }
3402 if let ::core::option::Option::Some(__v) = self.created_at {
3403 struct _W(i64);
3404 impl ::serde::Serialize for _W {
3405 fn serialize<__S: ::serde::Serializer>(
3406 &self,
3407 __s: __S,
3408 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3409 ::buffa::json_helpers::int64::serialize(&self.0, __s)
3410 }
3411 }
3412 __map.serialize_entry("created_at", &_W(__v))?;
3413 }
3414 if let ::core::option::Option::Some(__v) = self.created_by {
3415 __map.serialize_entry("created_by", __v)?;
3416 }
3417 if let ::core::option::Option::Some(__v) = self.updated_at {
3418 struct _W(i64);
3419 impl ::serde::Serialize for _W {
3420 fn serialize<__S: ::serde::Serializer>(
3421 &self,
3422 __s: __S,
3423 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3424 ::buffa::json_helpers::int64::serialize(&self.0, __s)
3425 }
3426 }
3427 __map.serialize_entry("updated_at", &_W(__v))?;
3428 }
3429 if let ::core::option::Option::Some(__v) = self.updated_by {
3430 __map.serialize_entry("updated_by", __v)?;
3431 }
3432 if let ::core::option::Option::Some(__v) = self.metastore_id {
3433 __map.serialize_entry("metastore_id", __v)?;
3434 }
3435 __map.end()
3436 }
3437 }
3438 impl<'a> ::buffa::MessageName for AgentView<'a> {
3439 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
3440 const NAME: &'static str = "Agent";
3441 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.Agent";
3442 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.Agent";
3443 }
3444 impl<'v> ::buffa::DefaultViewInstance for AgentView<'v> {
3445 fn default_view_instance<'a>() -> &'a Self
3446 where
3447 Self: 'a,
3448 {
3449 static VALUE: ::buffa::__private::OnceBox<AgentView<'static>> = ::buffa::__private::OnceBox::new();
3450 VALUE
3451 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
3452 <AgentView<'static>>::default(),
3453 ))
3454 }
3455 }
3456 impl ::buffa::ViewReborrow for AgentView<'static> {
3457 type Reborrowed<'b> = AgentView<'b>;
3458 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
3459 this
3460 }
3461 }
3462 #[derive(Clone, Debug)]
3468 pub struct AgentOwnedView(::buffa::OwnedView<AgentView<'static>>);
3469 impl AgentOwnedView {
3470 pub fn decode(
3480 bytes: ::buffa::bytes::Bytes,
3481 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3482 ::core::result::Result::Ok(
3483 AgentOwnedView(::buffa::OwnedView::decode(bytes)?),
3484 )
3485 }
3486 pub fn decode_with_options(
3494 bytes: ::buffa::bytes::Bytes,
3495 opts: &::buffa::DecodeOptions,
3496 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3497 ::core::result::Result::Ok(
3498 AgentOwnedView(::buffa::OwnedView::decode_with_options(bytes, opts)?),
3499 )
3500 }
3501 pub fn from_owned(
3508 msg: &super::super::Agent,
3509 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3510 ::core::result::Result::Ok(
3511 AgentOwnedView(::buffa::OwnedView::from_owned(msg)?),
3512 )
3513 }
3514 #[must_use]
3516 pub fn view(&self) -> &AgentView<'_> {
3517 self.0.reborrow()
3518 }
3519 #[must_use]
3521 pub fn to_owned_message(&self) -> super::super::Agent {
3522 self.0.to_owned_message()
3523 }
3524 #[must_use]
3526 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3527 self.0.bytes()
3528 }
3529 #[must_use]
3531 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3532 self.0.into_bytes()
3533 }
3534 #[must_use]
3538 pub fn name(&self) -> &'_ str {
3539 self.0.reborrow().name
3540 }
3541 #[must_use]
3545 pub fn catalog_name(&self) -> &'_ str {
3546 self.0.reborrow().catalog_name
3547 }
3548 #[must_use]
3552 pub fn schema_name(&self) -> &'_ str {
3553 self.0.reborrow().schema_name
3554 }
3555 #[must_use]
3559 pub fn full_name(&self) -> &'_ str {
3560 self.0.reborrow().full_name
3561 }
3562 #[must_use]
3566 pub fn agent_id(&self) -> &'_ str {
3567 self.0.reborrow().agent_id
3568 }
3569 #[must_use]
3573 pub fn invocation_protocol(
3574 &self,
3575 ) -> ::buffa::EnumValue<super::super::InvocationProtocol> {
3576 self.0.reborrow().invocation_protocol
3577 }
3578 #[must_use]
3582 pub fn endpoint(&self) -> &'_ str {
3583 self.0.reborrow().endpoint
3584 }
3585 #[must_use]
3590 pub fn description(&self) -> ::core::option::Option<&'_ str> {
3591 self.0.reborrow().description
3592 }
3593 #[must_use]
3598 pub fn capabilities(&self) -> &::buffa::RepeatedView<'_, &'_ str> {
3599 &self.0.reborrow().capabilities
3600 }
3601 #[must_use]
3607 pub fn input_schema(&self) -> ::core::option::Option<&'_ str> {
3608 self.0.reborrow().input_schema
3609 }
3610 #[must_use]
3614 pub fn owner(&self) -> ::core::option::Option<&'_ str> {
3615 self.0.reborrow().owner
3616 }
3617 #[must_use]
3621 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
3622 self.0.reborrow().comment
3623 }
3624 #[must_use]
3628 pub fn created_at(&self) -> ::core::option::Option<i64> {
3629 self.0.reborrow().created_at
3630 }
3631 #[must_use]
3635 pub fn created_by(&self) -> ::core::option::Option<&'_ str> {
3636 self.0.reborrow().created_by
3637 }
3638 #[must_use]
3642 pub fn updated_at(&self) -> ::core::option::Option<i64> {
3643 self.0.reborrow().updated_at
3644 }
3645 #[must_use]
3649 pub fn updated_by(&self) -> ::core::option::Option<&'_ str> {
3650 self.0.reborrow().updated_by
3651 }
3652 #[must_use]
3656 pub fn metastore_id(&self) -> ::core::option::Option<&'_ str> {
3657 self.0.reborrow().metastore_id
3658 }
3659 }
3660 impl ::core::convert::From<::buffa::OwnedView<AgentView<'static>>>
3661 for AgentOwnedView {
3662 fn from(inner: ::buffa::OwnedView<AgentView<'static>>) -> Self {
3663 AgentOwnedView(inner)
3664 }
3665 }
3666 impl ::core::convert::From<AgentOwnedView>
3667 for ::buffa::OwnedView<AgentView<'static>> {
3668 fn from(wrapper: AgentOwnedView) -> Self {
3669 wrapper.0
3670 }
3671 }
3672 impl ::core::convert::AsRef<::buffa::OwnedView<AgentView<'static>>>
3673 for AgentOwnedView {
3674 fn as_ref(&self) -> &::buffa::OwnedView<AgentView<'static>> {
3675 &self.0
3676 }
3677 }
3678 impl ::buffa::HasMessageView for super::super::Agent {
3679 type View<'a> = AgentView<'a>;
3680 type ViewHandle = AgentOwnedView;
3681 }
3682 impl ::serde::Serialize for AgentOwnedView {
3683 fn serialize<__S: ::serde::Serializer>(
3684 &self,
3685 __s: __S,
3686 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3687 ::serde::Serialize::serialize(&self.0, __s)
3688 }
3689 }
3690 #[derive(Clone, Debug, Default)]
3692 pub struct ListAgentsRequestView<'a> {
3693 pub catalog_name: &'a str,
3697 pub schema_name: &'a str,
3701 pub max_results: ::core::option::Option<i32>,
3705 pub page_token: ::core::option::Option<&'a str>,
3709 pub include_browse: ::core::option::Option<bool>,
3714 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
3715 }
3716 impl<'a> ListAgentsRequestView<'a> {
3717 #[doc(hidden)]
3725 pub fn _decode_depth(
3726 buf: &'a [u8],
3727 depth: u32,
3728 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3729 let mut view = Self::default();
3730 view._merge_into_view(buf, depth)?;
3731 ::core::result::Result::Ok(view)
3732 }
3733 #[doc(hidden)]
3741 pub fn _merge_into_view(
3742 &mut self,
3743 buf: &'a [u8],
3744 depth: u32,
3745 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3746 let _ = depth;
3747 #[allow(unused_variables)]
3748 let view = self;
3749 let mut cur: &'a [u8] = buf;
3750 while !cur.is_empty() {
3751 let before_tag = cur;
3752 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
3753 match tag.field_number() {
3754 1u32 => {
3755 if tag.wire_type()
3756 != ::buffa::encoding::WireType::LengthDelimited
3757 {
3758 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3759 field_number: 1u32,
3760 expected: 2u8,
3761 actual: tag.wire_type() as u8,
3762 });
3763 }
3764 view.catalog_name = ::buffa::types::borrow_str(&mut cur)?;
3765 }
3766 2u32 => {
3767 if tag.wire_type()
3768 != ::buffa::encoding::WireType::LengthDelimited
3769 {
3770 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3771 field_number: 2u32,
3772 expected: 2u8,
3773 actual: tag.wire_type() as u8,
3774 });
3775 }
3776 view.schema_name = ::buffa::types::borrow_str(&mut cur)?;
3777 }
3778 3u32 => {
3779 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3780 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3781 field_number: 3u32,
3782 expected: 0u8,
3783 actual: tag.wire_type() as u8,
3784 });
3785 }
3786 view.max_results = Some(
3787 ::buffa::types::decode_int32(&mut cur)?,
3788 );
3789 }
3790 4u32 => {
3791 if tag.wire_type()
3792 != ::buffa::encoding::WireType::LengthDelimited
3793 {
3794 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3795 field_number: 4u32,
3796 expected: 2u8,
3797 actual: tag.wire_type() as u8,
3798 });
3799 }
3800 view.page_token = Some(
3801 ::buffa::types::borrow_str(&mut cur)?,
3802 );
3803 }
3804 5u32 => {
3805 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3806 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3807 field_number: 5u32,
3808 expected: 0u8,
3809 actual: tag.wire_type() as u8,
3810 });
3811 }
3812 view.include_browse = Some(
3813 ::buffa::types::decode_bool(&mut cur)?,
3814 );
3815 }
3816 _ => {
3817 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
3818 let span_len = before_tag.len() - cur.len();
3819 view.__buffa_unknown_fields
3820 .push_raw(&before_tag[..span_len]);
3821 }
3822 }
3823 }
3824 ::core::result::Result::Ok(())
3825 }
3826 }
3827 impl<'a> ::buffa::MessageView<'a> for ListAgentsRequestView<'a> {
3828 type Owned = super::super::ListAgentsRequest;
3829 fn decode_view(
3830 buf: &'a [u8],
3831 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3832 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
3833 }
3834 fn decode_view_with_limit(
3835 buf: &'a [u8],
3836 depth: u32,
3837 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3838 Self::_decode_depth(buf, depth)
3839 }
3840 fn to_owned_message(&self) -> super::super::ListAgentsRequest {
3841 self.to_owned_from_source(None)
3842 }
3843 #[allow(clippy::useless_conversion, clippy::needless_update)]
3844 fn to_owned_from_source(
3845 &self,
3846 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3847 ) -> super::super::ListAgentsRequest {
3848 #[allow(unused_imports)]
3849 use ::buffa::alloc::string::ToString as _;
3850 let _ = __buffa_src;
3851 super::super::ListAgentsRequest {
3852 catalog_name: self.catalog_name.to_string(),
3853 schema_name: self.schema_name.to_string(),
3854 max_results: self.max_results,
3855 page_token: self.page_token.map(|s| s.to_string()),
3856 include_browse: self.include_browse,
3857 __buffa_unknown_fields: self
3858 .__buffa_unknown_fields
3859 .to_owned()
3860 .unwrap_or_default()
3861 .into(),
3862 ..::core::default::Default::default()
3863 }
3864 }
3865 }
3866 impl<'a> ::buffa::ViewEncode<'a> for ListAgentsRequestView<'a> {
3867 #[allow(clippy::needless_borrow, clippy::let_and_return)]
3868 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3869 #[allow(unused_imports)]
3870 use ::buffa::Enumeration as _;
3871 let mut size = 0u32;
3872 if !self.catalog_name.is_empty() {
3873 size
3874 += 1u32
3875 + ::buffa::types::string_encoded_len(&self.catalog_name)
3876 as u32;
3877 }
3878 if !self.schema_name.is_empty() {
3879 size
3880 += 1u32
3881 + ::buffa::types::string_encoded_len(&self.schema_name)
3882 as u32;
3883 }
3884 if let Some(v) = self.max_results {
3885 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
3886 }
3887 if let Some(ref v) = self.page_token {
3888 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3889 }
3890 if self.include_browse.is_some() {
3891 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
3892 }
3893 size += self.__buffa_unknown_fields.encoded_len() as u32;
3894 size
3895 }
3896 #[allow(clippy::needless_borrow)]
3897 fn write_to(
3898 &self,
3899 _cache: &mut ::buffa::SizeCache,
3900 buf: &mut impl ::buffa::bytes::BufMut,
3901 ) {
3902 #[allow(unused_imports)]
3903 use ::buffa::Enumeration as _;
3904 if !self.catalog_name.is_empty() {
3905 ::buffa::encoding::Tag::new(
3906 1u32,
3907 ::buffa::encoding::WireType::LengthDelimited,
3908 )
3909 .encode(buf);
3910 ::buffa::types::encode_string(&self.catalog_name, buf);
3911 }
3912 if !self.schema_name.is_empty() {
3913 ::buffa::encoding::Tag::new(
3914 2u32,
3915 ::buffa::encoding::WireType::LengthDelimited,
3916 )
3917 .encode(buf);
3918 ::buffa::types::encode_string(&self.schema_name, buf);
3919 }
3920 if let Some(v) = self.max_results {
3921 ::buffa::encoding::Tag::new(
3922 3u32,
3923 ::buffa::encoding::WireType::Varint,
3924 )
3925 .encode(buf);
3926 ::buffa::types::encode_int32(v, buf);
3927 }
3928 if let Some(ref v) = self.page_token {
3929 ::buffa::encoding::Tag::new(
3930 4u32,
3931 ::buffa::encoding::WireType::LengthDelimited,
3932 )
3933 .encode(buf);
3934 ::buffa::types::encode_string(v, buf);
3935 }
3936 if let Some(v) = self.include_browse {
3937 ::buffa::encoding::Tag::new(
3938 5u32,
3939 ::buffa::encoding::WireType::Varint,
3940 )
3941 .encode(buf);
3942 ::buffa::types::encode_bool(v, buf);
3943 }
3944 self.__buffa_unknown_fields.write_to(buf);
3945 }
3946 }
3947 impl<'__a> ::serde::Serialize for ListAgentsRequestView<'__a> {
3959 fn serialize<__S: ::serde::Serializer>(
3960 &self,
3961 __s: __S,
3962 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3963 use ::serde::ser::SerializeMap as _;
3964 let mut __map = __s.serialize_map(::core::option::Option::None)?;
3965 if !::buffa::json_helpers::skip_if::is_empty_str(self.catalog_name) {
3966 __map.serialize_entry("catalog_name", self.catalog_name)?;
3967 }
3968 if !::buffa::json_helpers::skip_if::is_empty_str(self.schema_name) {
3969 __map.serialize_entry("schema_name", self.schema_name)?;
3970 }
3971 if let ::core::option::Option::Some(__v) = self.max_results {
3972 struct _W(i32);
3973 impl ::serde::Serialize for _W {
3974 fn serialize<__S: ::serde::Serializer>(
3975 &self,
3976 __s: __S,
3977 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3978 ::buffa::json_helpers::int32::serialize(&self.0, __s)
3979 }
3980 }
3981 __map.serialize_entry("max_results", &_W(__v))?;
3982 }
3983 if let ::core::option::Option::Some(__v) = self.page_token {
3984 __map.serialize_entry("page_token", __v)?;
3985 }
3986 if let ::core::option::Option::Some(__v) = self.include_browse {
3987 __map.serialize_entry("include_browse", &__v)?;
3988 }
3989 __map.end()
3990 }
3991 }
3992 impl<'a> ::buffa::MessageName for ListAgentsRequestView<'a> {
3993 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
3994 const NAME: &'static str = "ListAgentsRequest";
3995 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.ListAgentsRequest";
3996 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.ListAgentsRequest";
3997 }
3998 impl<'v> ::buffa::DefaultViewInstance for ListAgentsRequestView<'v> {
3999 fn default_view_instance<'a>() -> &'a Self
4000 where
4001 Self: 'a,
4002 {
4003 static VALUE: ::buffa::__private::OnceBox<
4004 ListAgentsRequestView<'static>,
4005 > = ::buffa::__private::OnceBox::new();
4006 VALUE
4007 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
4008 <ListAgentsRequestView<'static>>::default(),
4009 ))
4010 }
4011 }
4012 impl ::buffa::ViewReborrow for ListAgentsRequestView<'static> {
4013 type Reborrowed<'b> = ListAgentsRequestView<'b>;
4014 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
4015 this
4016 }
4017 }
4018 #[derive(Clone, Debug)]
4024 pub struct ListAgentsRequestOwnedView(
4025 ::buffa::OwnedView<ListAgentsRequestView<'static>>,
4026 );
4027 impl ListAgentsRequestOwnedView {
4028 pub fn decode(
4038 bytes: ::buffa::bytes::Bytes,
4039 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4040 ::core::result::Result::Ok(
4041 ListAgentsRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
4042 )
4043 }
4044 pub fn decode_with_options(
4052 bytes: ::buffa::bytes::Bytes,
4053 opts: &::buffa::DecodeOptions,
4054 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4055 ::core::result::Result::Ok(
4056 ListAgentsRequestOwnedView(
4057 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4058 ),
4059 )
4060 }
4061 pub fn from_owned(
4068 msg: &super::super::ListAgentsRequest,
4069 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4070 ::core::result::Result::Ok(
4071 ListAgentsRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
4072 )
4073 }
4074 #[must_use]
4076 pub fn view(&self) -> &ListAgentsRequestView<'_> {
4077 self.0.reborrow()
4078 }
4079 #[must_use]
4081 pub fn to_owned_message(&self) -> super::super::ListAgentsRequest {
4082 self.0.to_owned_message()
4083 }
4084 #[must_use]
4086 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4087 self.0.bytes()
4088 }
4089 #[must_use]
4091 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4092 self.0.into_bytes()
4093 }
4094 #[must_use]
4098 pub fn catalog_name(&self) -> &'_ str {
4099 self.0.reborrow().catalog_name
4100 }
4101 #[must_use]
4105 pub fn schema_name(&self) -> &'_ str {
4106 self.0.reborrow().schema_name
4107 }
4108 #[must_use]
4112 pub fn max_results(&self) -> ::core::option::Option<i32> {
4113 self.0.reborrow().max_results
4114 }
4115 #[must_use]
4119 pub fn page_token(&self) -> ::core::option::Option<&'_ str> {
4120 self.0.reborrow().page_token
4121 }
4122 #[must_use]
4127 pub fn include_browse(&self) -> ::core::option::Option<bool> {
4128 self.0.reborrow().include_browse
4129 }
4130 }
4131 impl ::core::convert::From<::buffa::OwnedView<ListAgentsRequestView<'static>>>
4132 for ListAgentsRequestOwnedView {
4133 fn from(inner: ::buffa::OwnedView<ListAgentsRequestView<'static>>) -> Self {
4134 ListAgentsRequestOwnedView(inner)
4135 }
4136 }
4137 impl ::core::convert::From<ListAgentsRequestOwnedView>
4138 for ::buffa::OwnedView<ListAgentsRequestView<'static>> {
4139 fn from(wrapper: ListAgentsRequestOwnedView) -> Self {
4140 wrapper.0
4141 }
4142 }
4143 impl ::core::convert::AsRef<::buffa::OwnedView<ListAgentsRequestView<'static>>>
4144 for ListAgentsRequestOwnedView {
4145 fn as_ref(&self) -> &::buffa::OwnedView<ListAgentsRequestView<'static>> {
4146 &self.0
4147 }
4148 }
4149 impl ::buffa::HasMessageView for super::super::ListAgentsRequest {
4150 type View<'a> = ListAgentsRequestView<'a>;
4151 type ViewHandle = ListAgentsRequestOwnedView;
4152 }
4153 impl ::serde::Serialize for ListAgentsRequestOwnedView {
4154 fn serialize<__S: ::serde::Serializer>(
4155 &self,
4156 __s: __S,
4157 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4158 ::serde::Serialize::serialize(&self.0, __s)
4159 }
4160 }
4161 #[derive(Clone, Debug, Default)]
4163 pub struct ListAgentsResponseView<'a> {
4164 pub agents: ::buffa::RepeatedView<
4168 'a,
4169 super::super::__buffa::view::AgentView<'a>,
4170 >,
4171 pub next_page_token: ::core::option::Option<&'a str>,
4178 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4179 }
4180 impl<'a> ListAgentsResponseView<'a> {
4181 #[doc(hidden)]
4189 pub fn _decode_depth(
4190 buf: &'a [u8],
4191 depth: u32,
4192 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4193 let mut view = Self::default();
4194 view._merge_into_view(buf, depth)?;
4195 ::core::result::Result::Ok(view)
4196 }
4197 #[doc(hidden)]
4205 pub fn _merge_into_view(
4206 &mut self,
4207 buf: &'a [u8],
4208 depth: u32,
4209 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4210 let _ = depth;
4211 #[allow(unused_variables)]
4212 let view = self;
4213 let mut cur: &'a [u8] = buf;
4214 while !cur.is_empty() {
4215 let before_tag = cur;
4216 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
4217 match tag.field_number() {
4218 2u32 => {
4219 if tag.wire_type()
4220 != ::buffa::encoding::WireType::LengthDelimited
4221 {
4222 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4223 field_number: 2u32,
4224 expected: 2u8,
4225 actual: tag.wire_type() as u8,
4226 });
4227 }
4228 view.next_page_token = Some(
4229 ::buffa::types::borrow_str(&mut cur)?,
4230 );
4231 }
4232 1u32 => {
4233 if tag.wire_type()
4234 != ::buffa::encoding::WireType::LengthDelimited
4235 {
4236 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4237 field_number: 1u32,
4238 expected: 2u8,
4239 actual: tag.wire_type() as u8,
4240 });
4241 }
4242 if depth == 0 {
4243 return Err(::buffa::DecodeError::RecursionLimitExceeded);
4244 }
4245 let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4246 view.agents
4247 .push(
4248 super::super::__buffa::view::AgentView::_decode_depth(
4249 sub,
4250 depth - 1,
4251 )?,
4252 );
4253 }
4254 _ => {
4255 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4256 let span_len = before_tag.len() - cur.len();
4257 view.__buffa_unknown_fields
4258 .push_raw(&before_tag[..span_len]);
4259 }
4260 }
4261 }
4262 ::core::result::Result::Ok(())
4263 }
4264 }
4265 impl<'a> ::buffa::MessageView<'a> for ListAgentsResponseView<'a> {
4266 type Owned = super::super::ListAgentsResponse;
4267 fn decode_view(
4268 buf: &'a [u8],
4269 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4270 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
4271 }
4272 fn decode_view_with_limit(
4273 buf: &'a [u8],
4274 depth: u32,
4275 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4276 Self::_decode_depth(buf, depth)
4277 }
4278 fn to_owned_message(&self) -> super::super::ListAgentsResponse {
4279 self.to_owned_from_source(None)
4280 }
4281 #[allow(clippy::useless_conversion, clippy::needless_update)]
4282 fn to_owned_from_source(
4283 &self,
4284 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4285 ) -> super::super::ListAgentsResponse {
4286 #[allow(unused_imports)]
4287 use ::buffa::alloc::string::ToString as _;
4288 let _ = __buffa_src;
4289 super::super::ListAgentsResponse {
4290 agents: self
4291 .agents
4292 .iter()
4293 .map(|v| v.to_owned_from_source(__buffa_src))
4294 .collect(),
4295 next_page_token: self.next_page_token.map(|s| s.to_string()),
4296 __buffa_unknown_fields: self
4297 .__buffa_unknown_fields
4298 .to_owned()
4299 .unwrap_or_default()
4300 .into(),
4301 ..::core::default::Default::default()
4302 }
4303 }
4304 }
4305 impl<'a> ::buffa::ViewEncode<'a> for ListAgentsResponseView<'a> {
4306 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4307 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4308 #[allow(unused_imports)]
4309 use ::buffa::Enumeration as _;
4310 let mut size = 0u32;
4311 for v in &self.agents {
4312 let __slot = __cache.reserve();
4313 let inner_size = v.compute_size(__cache);
4314 __cache.set(__slot, inner_size);
4315 size
4316 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4317 + inner_size;
4318 }
4319 if let Some(ref v) = self.next_page_token {
4320 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4321 }
4322 size += self.__buffa_unknown_fields.encoded_len() as u32;
4323 size
4324 }
4325 #[allow(clippy::needless_borrow)]
4326 fn write_to(
4327 &self,
4328 __cache: &mut ::buffa::SizeCache,
4329 buf: &mut impl ::buffa::bytes::BufMut,
4330 ) {
4331 #[allow(unused_imports)]
4332 use ::buffa::Enumeration as _;
4333 for v in &self.agents {
4334 ::buffa::encoding::Tag::new(
4335 1u32,
4336 ::buffa::encoding::WireType::LengthDelimited,
4337 )
4338 .encode(buf);
4339 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
4340 v.write_to(__cache, buf);
4341 }
4342 if let Some(ref v) = self.next_page_token {
4343 ::buffa::encoding::Tag::new(
4344 2u32,
4345 ::buffa::encoding::WireType::LengthDelimited,
4346 )
4347 .encode(buf);
4348 ::buffa::types::encode_string(v, buf);
4349 }
4350 self.__buffa_unknown_fields.write_to(buf);
4351 }
4352 }
4353 impl<'__a> ::serde::Serialize for ListAgentsResponseView<'__a> {
4365 fn serialize<__S: ::serde::Serializer>(
4366 &self,
4367 __s: __S,
4368 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4369 use ::serde::ser::SerializeMap as _;
4370 let mut __map = __s.serialize_map(::core::option::Option::None)?;
4371 if !self.agents.is_empty() {
4372 __map.serialize_entry("agents", &*self.agents)?;
4373 }
4374 if let ::core::option::Option::Some(__v) = self.next_page_token {
4375 __map.serialize_entry("next_page_token", __v)?;
4376 }
4377 __map.end()
4378 }
4379 }
4380 impl<'a> ::buffa::MessageName for ListAgentsResponseView<'a> {
4381 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
4382 const NAME: &'static str = "ListAgentsResponse";
4383 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.ListAgentsResponse";
4384 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.ListAgentsResponse";
4385 }
4386 impl<'v> ::buffa::DefaultViewInstance for ListAgentsResponseView<'v> {
4387 fn default_view_instance<'a>() -> &'a Self
4388 where
4389 Self: 'a,
4390 {
4391 static VALUE: ::buffa::__private::OnceBox<
4392 ListAgentsResponseView<'static>,
4393 > = ::buffa::__private::OnceBox::new();
4394 VALUE
4395 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
4396 <ListAgentsResponseView<'static>>::default(),
4397 ))
4398 }
4399 }
4400 impl ::buffa::ViewReborrow for ListAgentsResponseView<'static> {
4401 type Reborrowed<'b> = ListAgentsResponseView<'b>;
4402 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
4403 this
4404 }
4405 }
4406 #[derive(Clone, Debug)]
4412 pub struct ListAgentsResponseOwnedView(
4413 ::buffa::OwnedView<ListAgentsResponseView<'static>>,
4414 );
4415 impl ListAgentsResponseOwnedView {
4416 pub fn decode(
4426 bytes: ::buffa::bytes::Bytes,
4427 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4428 ::core::result::Result::Ok(
4429 ListAgentsResponseOwnedView(::buffa::OwnedView::decode(bytes)?),
4430 )
4431 }
4432 pub fn decode_with_options(
4440 bytes: ::buffa::bytes::Bytes,
4441 opts: &::buffa::DecodeOptions,
4442 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4443 ::core::result::Result::Ok(
4444 ListAgentsResponseOwnedView(
4445 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4446 ),
4447 )
4448 }
4449 pub fn from_owned(
4456 msg: &super::super::ListAgentsResponse,
4457 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4458 ::core::result::Result::Ok(
4459 ListAgentsResponseOwnedView(::buffa::OwnedView::from_owned(msg)?),
4460 )
4461 }
4462 #[must_use]
4464 pub fn view(&self) -> &ListAgentsResponseView<'_> {
4465 self.0.reborrow()
4466 }
4467 #[must_use]
4469 pub fn to_owned_message(&self) -> super::super::ListAgentsResponse {
4470 self.0.to_owned_message()
4471 }
4472 #[must_use]
4474 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4475 self.0.bytes()
4476 }
4477 #[must_use]
4479 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4480 self.0.into_bytes()
4481 }
4482 #[must_use]
4486 pub fn agents(
4487 &self,
4488 ) -> &::buffa::RepeatedView<'_, super::super::__buffa::view::AgentView<'_>> {
4489 &self.0.reborrow().agents
4490 }
4491 #[must_use]
4498 pub fn next_page_token(&self) -> ::core::option::Option<&'_ str> {
4499 self.0.reborrow().next_page_token
4500 }
4501 }
4502 impl ::core::convert::From<::buffa::OwnedView<ListAgentsResponseView<'static>>>
4503 for ListAgentsResponseOwnedView {
4504 fn from(inner: ::buffa::OwnedView<ListAgentsResponseView<'static>>) -> Self {
4505 ListAgentsResponseOwnedView(inner)
4506 }
4507 }
4508 impl ::core::convert::From<ListAgentsResponseOwnedView>
4509 for ::buffa::OwnedView<ListAgentsResponseView<'static>> {
4510 fn from(wrapper: ListAgentsResponseOwnedView) -> Self {
4511 wrapper.0
4512 }
4513 }
4514 impl ::core::convert::AsRef<::buffa::OwnedView<ListAgentsResponseView<'static>>>
4515 for ListAgentsResponseOwnedView {
4516 fn as_ref(&self) -> &::buffa::OwnedView<ListAgentsResponseView<'static>> {
4517 &self.0
4518 }
4519 }
4520 impl ::buffa::HasMessageView for super::super::ListAgentsResponse {
4521 type View<'a> = ListAgentsResponseView<'a>;
4522 type ViewHandle = ListAgentsResponseOwnedView;
4523 }
4524 impl ::serde::Serialize for ListAgentsResponseOwnedView {
4525 fn serialize<__S: ::serde::Serializer>(
4526 &self,
4527 __s: __S,
4528 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4529 ::serde::Serialize::serialize(&self.0, __s)
4530 }
4531 }
4532 #[derive(Clone, Debug, Default)]
4534 pub struct CreateAgentRequestView<'a> {
4535 pub catalog_name: &'a str,
4539 pub schema_name: &'a str,
4543 pub name: &'a str,
4547 pub invocation_protocol: ::buffa::EnumValue<
4551 super::super::InvocationProtocol,
4552 >,
4553 pub endpoint: &'a str,
4557 pub description: ::core::option::Option<&'a str>,
4561 pub capabilities: ::buffa::RepeatedView<'a, &'a str>,
4565 pub input_schema: ::core::option::Option<&'a str>,
4569 pub comment: ::core::option::Option<&'a str>,
4573 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4574 }
4575 impl<'a> CreateAgentRequestView<'a> {
4576 #[doc(hidden)]
4584 pub fn _decode_depth(
4585 buf: &'a [u8],
4586 depth: u32,
4587 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4588 let mut view = Self::default();
4589 view._merge_into_view(buf, depth)?;
4590 ::core::result::Result::Ok(view)
4591 }
4592 #[doc(hidden)]
4600 pub fn _merge_into_view(
4601 &mut self,
4602 buf: &'a [u8],
4603 depth: u32,
4604 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4605 let _ = depth;
4606 #[allow(unused_variables)]
4607 let view = self;
4608 let mut cur: &'a [u8] = buf;
4609 while !cur.is_empty() {
4610 let before_tag = cur;
4611 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
4612 match tag.field_number() {
4613 1u32 => {
4614 if tag.wire_type()
4615 != ::buffa::encoding::WireType::LengthDelimited
4616 {
4617 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4618 field_number: 1u32,
4619 expected: 2u8,
4620 actual: tag.wire_type() as u8,
4621 });
4622 }
4623 view.catalog_name = ::buffa::types::borrow_str(&mut cur)?;
4624 }
4625 2u32 => {
4626 if tag.wire_type()
4627 != ::buffa::encoding::WireType::LengthDelimited
4628 {
4629 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4630 field_number: 2u32,
4631 expected: 2u8,
4632 actual: tag.wire_type() as u8,
4633 });
4634 }
4635 view.schema_name = ::buffa::types::borrow_str(&mut cur)?;
4636 }
4637 3u32 => {
4638 if tag.wire_type()
4639 != ::buffa::encoding::WireType::LengthDelimited
4640 {
4641 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4642 field_number: 3u32,
4643 expected: 2u8,
4644 actual: tag.wire_type() as u8,
4645 });
4646 }
4647 view.name = ::buffa::types::borrow_str(&mut cur)?;
4648 }
4649 4u32 => {
4650 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4651 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4652 field_number: 4u32,
4653 expected: 0u8,
4654 actual: tag.wire_type() as u8,
4655 });
4656 }
4657 view.invocation_protocol = ::buffa::EnumValue::from(
4658 ::buffa::types::decode_int32(&mut cur)?,
4659 );
4660 }
4661 5u32 => {
4662 if tag.wire_type()
4663 != ::buffa::encoding::WireType::LengthDelimited
4664 {
4665 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4666 field_number: 5u32,
4667 expected: 2u8,
4668 actual: tag.wire_type() as u8,
4669 });
4670 }
4671 view.endpoint = ::buffa::types::borrow_str(&mut cur)?;
4672 }
4673 6u32 => {
4674 if tag.wire_type()
4675 != ::buffa::encoding::WireType::LengthDelimited
4676 {
4677 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4678 field_number: 6u32,
4679 expected: 2u8,
4680 actual: tag.wire_type() as u8,
4681 });
4682 }
4683 view.description = Some(
4684 ::buffa::types::borrow_str(&mut cur)?,
4685 );
4686 }
4687 8u32 => {
4688 if tag.wire_type()
4689 != ::buffa::encoding::WireType::LengthDelimited
4690 {
4691 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4692 field_number: 8u32,
4693 expected: 2u8,
4694 actual: tag.wire_type() as u8,
4695 });
4696 }
4697 view.input_schema = Some(
4698 ::buffa::types::borrow_str(&mut cur)?,
4699 );
4700 }
4701 9u32 => {
4702 if tag.wire_type()
4703 != ::buffa::encoding::WireType::LengthDelimited
4704 {
4705 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4706 field_number: 9u32,
4707 expected: 2u8,
4708 actual: tag.wire_type() as u8,
4709 });
4710 }
4711 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
4712 }
4713 7u32 => {
4714 if tag.wire_type()
4715 != ::buffa::encoding::WireType::LengthDelimited
4716 {
4717 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4718 field_number: 7u32,
4719 expected: 2u8,
4720 actual: tag.wire_type() as u8,
4721 });
4722 }
4723 view.capabilities
4724 .push(::buffa::types::borrow_str(&mut cur)?);
4725 }
4726 _ => {
4727 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4728 let span_len = before_tag.len() - cur.len();
4729 view.__buffa_unknown_fields
4730 .push_raw(&before_tag[..span_len]);
4731 }
4732 }
4733 }
4734 ::core::result::Result::Ok(())
4735 }
4736 }
4737 impl<'a> ::buffa::MessageView<'a> for CreateAgentRequestView<'a> {
4738 type Owned = super::super::CreateAgentRequest;
4739 fn decode_view(
4740 buf: &'a [u8],
4741 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4742 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
4743 }
4744 fn decode_view_with_limit(
4745 buf: &'a [u8],
4746 depth: u32,
4747 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4748 Self::_decode_depth(buf, depth)
4749 }
4750 fn to_owned_message(&self) -> super::super::CreateAgentRequest {
4751 self.to_owned_from_source(None)
4752 }
4753 #[allow(clippy::useless_conversion, clippy::needless_update)]
4754 fn to_owned_from_source(
4755 &self,
4756 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4757 ) -> super::super::CreateAgentRequest {
4758 #[allow(unused_imports)]
4759 use ::buffa::alloc::string::ToString as _;
4760 let _ = __buffa_src;
4761 super::super::CreateAgentRequest {
4762 catalog_name: self.catalog_name.to_string(),
4763 schema_name: self.schema_name.to_string(),
4764 name: self.name.to_string(),
4765 invocation_protocol: self.invocation_protocol,
4766 endpoint: self.endpoint.to_string(),
4767 description: self.description.map(|s| s.to_string()),
4768 capabilities: self
4769 .capabilities
4770 .iter()
4771 .map(|s| s.to_string())
4772 .collect(),
4773 input_schema: self.input_schema.map(|s| s.to_string()),
4774 comment: self.comment.map(|s| s.to_string()),
4775 __buffa_unknown_fields: self
4776 .__buffa_unknown_fields
4777 .to_owned()
4778 .unwrap_or_default()
4779 .into(),
4780 ..::core::default::Default::default()
4781 }
4782 }
4783 }
4784 impl<'a> ::buffa::ViewEncode<'a> for CreateAgentRequestView<'a> {
4785 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4786 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
4787 #[allow(unused_imports)]
4788 use ::buffa::Enumeration as _;
4789 let mut size = 0u32;
4790 if !self.catalog_name.is_empty() {
4791 size
4792 += 1u32
4793 + ::buffa::types::string_encoded_len(&self.catalog_name)
4794 as u32;
4795 }
4796 if !self.schema_name.is_empty() {
4797 size
4798 += 1u32
4799 + ::buffa::types::string_encoded_len(&self.schema_name)
4800 as u32;
4801 }
4802 if !self.name.is_empty() {
4803 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
4804 }
4805 {
4806 let val = self.invocation_protocol.to_i32();
4807 if val != 0 {
4808 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
4809 }
4810 }
4811 if !self.endpoint.is_empty() {
4812 size
4813 += 1u32
4814 + ::buffa::types::string_encoded_len(&self.endpoint) as u32;
4815 }
4816 if let Some(ref v) = self.description {
4817 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4818 }
4819 for v in &self.capabilities {
4820 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4821 }
4822 if let Some(ref v) = self.input_schema {
4823 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4824 }
4825 if let Some(ref v) = self.comment {
4826 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4827 }
4828 size += self.__buffa_unknown_fields.encoded_len() as u32;
4829 size
4830 }
4831 #[allow(clippy::needless_borrow)]
4832 fn write_to(
4833 &self,
4834 _cache: &mut ::buffa::SizeCache,
4835 buf: &mut impl ::buffa::bytes::BufMut,
4836 ) {
4837 #[allow(unused_imports)]
4838 use ::buffa::Enumeration as _;
4839 if !self.catalog_name.is_empty() {
4840 ::buffa::encoding::Tag::new(
4841 1u32,
4842 ::buffa::encoding::WireType::LengthDelimited,
4843 )
4844 .encode(buf);
4845 ::buffa::types::encode_string(&self.catalog_name, buf);
4846 }
4847 if !self.schema_name.is_empty() {
4848 ::buffa::encoding::Tag::new(
4849 2u32,
4850 ::buffa::encoding::WireType::LengthDelimited,
4851 )
4852 .encode(buf);
4853 ::buffa::types::encode_string(&self.schema_name, buf);
4854 }
4855 if !self.name.is_empty() {
4856 ::buffa::encoding::Tag::new(
4857 3u32,
4858 ::buffa::encoding::WireType::LengthDelimited,
4859 )
4860 .encode(buf);
4861 ::buffa::types::encode_string(&self.name, buf);
4862 }
4863 {
4864 let val = self.invocation_protocol.to_i32();
4865 if val != 0 {
4866 ::buffa::encoding::Tag::new(
4867 4u32,
4868 ::buffa::encoding::WireType::Varint,
4869 )
4870 .encode(buf);
4871 ::buffa::types::encode_int32(val, buf);
4872 }
4873 }
4874 if !self.endpoint.is_empty() {
4875 ::buffa::encoding::Tag::new(
4876 5u32,
4877 ::buffa::encoding::WireType::LengthDelimited,
4878 )
4879 .encode(buf);
4880 ::buffa::types::encode_string(&self.endpoint, buf);
4881 }
4882 if let Some(ref v) = self.description {
4883 ::buffa::encoding::Tag::new(
4884 6u32,
4885 ::buffa::encoding::WireType::LengthDelimited,
4886 )
4887 .encode(buf);
4888 ::buffa::types::encode_string(v, buf);
4889 }
4890 for v in &self.capabilities {
4891 ::buffa::encoding::Tag::new(
4892 7u32,
4893 ::buffa::encoding::WireType::LengthDelimited,
4894 )
4895 .encode(buf);
4896 ::buffa::types::encode_string(v, buf);
4897 }
4898 if let Some(ref v) = self.input_schema {
4899 ::buffa::encoding::Tag::new(
4900 8u32,
4901 ::buffa::encoding::WireType::LengthDelimited,
4902 )
4903 .encode(buf);
4904 ::buffa::types::encode_string(v, buf);
4905 }
4906 if let Some(ref v) = self.comment {
4907 ::buffa::encoding::Tag::new(
4908 9u32,
4909 ::buffa::encoding::WireType::LengthDelimited,
4910 )
4911 .encode(buf);
4912 ::buffa::types::encode_string(v, buf);
4913 }
4914 self.__buffa_unknown_fields.write_to(buf);
4915 }
4916 }
4917 impl<'__a> ::serde::Serialize for CreateAgentRequestView<'__a> {
4929 fn serialize<__S: ::serde::Serializer>(
4930 &self,
4931 __s: __S,
4932 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4933 use ::serde::ser::SerializeMap as _;
4934 let mut __map = __s.serialize_map(::core::option::Option::None)?;
4935 if !::buffa::json_helpers::skip_if::is_empty_str(self.catalog_name) {
4936 __map.serialize_entry("catalog_name", self.catalog_name)?;
4937 }
4938 if !::buffa::json_helpers::skip_if::is_empty_str(self.schema_name) {
4939 __map.serialize_entry("schema_name", self.schema_name)?;
4940 }
4941 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
4942 __map.serialize_entry("name", self.name)?;
4943 }
4944 if !::buffa::json_helpers::skip_if::is_default_enum_value(
4945 &self.invocation_protocol,
4946 ) {
4947 __map
4948 .serialize_entry(
4949 "invocationProtocol",
4950 &self.invocation_protocol,
4951 )?;
4952 }
4953 if !::buffa::json_helpers::skip_if::is_empty_str(self.endpoint) {
4954 __map.serialize_entry("endpoint", self.endpoint)?;
4955 }
4956 if let ::core::option::Option::Some(__v) = self.description {
4957 __map.serialize_entry("description", __v)?;
4958 }
4959 if !self.capabilities.is_empty() {
4960 __map.serialize_entry("capabilities", &*self.capabilities)?;
4961 }
4962 if let ::core::option::Option::Some(__v) = self.input_schema {
4963 __map.serialize_entry("input_schema", __v)?;
4964 }
4965 if let ::core::option::Option::Some(__v) = self.comment {
4966 __map.serialize_entry("comment", __v)?;
4967 }
4968 __map.end()
4969 }
4970 }
4971 impl<'a> ::buffa::MessageName for CreateAgentRequestView<'a> {
4972 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
4973 const NAME: &'static str = "CreateAgentRequest";
4974 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.CreateAgentRequest";
4975 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.CreateAgentRequest";
4976 }
4977 impl<'v> ::buffa::DefaultViewInstance for CreateAgentRequestView<'v> {
4978 fn default_view_instance<'a>() -> &'a Self
4979 where
4980 Self: 'a,
4981 {
4982 static VALUE: ::buffa::__private::OnceBox<
4983 CreateAgentRequestView<'static>,
4984 > = ::buffa::__private::OnceBox::new();
4985 VALUE
4986 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
4987 <CreateAgentRequestView<'static>>::default(),
4988 ))
4989 }
4990 }
4991 impl ::buffa::ViewReborrow for CreateAgentRequestView<'static> {
4992 type Reborrowed<'b> = CreateAgentRequestView<'b>;
4993 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
4994 this
4995 }
4996 }
4997 #[derive(Clone, Debug)]
5003 pub struct CreateAgentRequestOwnedView(
5004 ::buffa::OwnedView<CreateAgentRequestView<'static>>,
5005 );
5006 impl CreateAgentRequestOwnedView {
5007 pub fn decode(
5017 bytes: ::buffa::bytes::Bytes,
5018 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5019 ::core::result::Result::Ok(
5020 CreateAgentRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
5021 )
5022 }
5023 pub fn decode_with_options(
5031 bytes: ::buffa::bytes::Bytes,
5032 opts: &::buffa::DecodeOptions,
5033 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5034 ::core::result::Result::Ok(
5035 CreateAgentRequestOwnedView(
5036 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5037 ),
5038 )
5039 }
5040 pub fn from_owned(
5047 msg: &super::super::CreateAgentRequest,
5048 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5049 ::core::result::Result::Ok(
5050 CreateAgentRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
5051 )
5052 }
5053 #[must_use]
5055 pub fn view(&self) -> &CreateAgentRequestView<'_> {
5056 self.0.reborrow()
5057 }
5058 #[must_use]
5060 pub fn to_owned_message(&self) -> super::super::CreateAgentRequest {
5061 self.0.to_owned_message()
5062 }
5063 #[must_use]
5065 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5066 self.0.bytes()
5067 }
5068 #[must_use]
5070 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5071 self.0.into_bytes()
5072 }
5073 #[must_use]
5077 pub fn catalog_name(&self) -> &'_ str {
5078 self.0.reborrow().catalog_name
5079 }
5080 #[must_use]
5084 pub fn schema_name(&self) -> &'_ str {
5085 self.0.reborrow().schema_name
5086 }
5087 #[must_use]
5091 pub fn name(&self) -> &'_ str {
5092 self.0.reborrow().name
5093 }
5094 #[must_use]
5098 pub fn invocation_protocol(
5099 &self,
5100 ) -> ::buffa::EnumValue<super::super::InvocationProtocol> {
5101 self.0.reborrow().invocation_protocol
5102 }
5103 #[must_use]
5107 pub fn endpoint(&self) -> &'_ str {
5108 self.0.reborrow().endpoint
5109 }
5110 #[must_use]
5114 pub fn description(&self) -> ::core::option::Option<&'_ str> {
5115 self.0.reborrow().description
5116 }
5117 #[must_use]
5121 pub fn capabilities(&self) -> &::buffa::RepeatedView<'_, &'_ str> {
5122 &self.0.reborrow().capabilities
5123 }
5124 #[must_use]
5128 pub fn input_schema(&self) -> ::core::option::Option<&'_ str> {
5129 self.0.reborrow().input_schema
5130 }
5131 #[must_use]
5135 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
5136 self.0.reborrow().comment
5137 }
5138 }
5139 impl ::core::convert::From<::buffa::OwnedView<CreateAgentRequestView<'static>>>
5140 for CreateAgentRequestOwnedView {
5141 fn from(inner: ::buffa::OwnedView<CreateAgentRequestView<'static>>) -> Self {
5142 CreateAgentRequestOwnedView(inner)
5143 }
5144 }
5145 impl ::core::convert::From<CreateAgentRequestOwnedView>
5146 for ::buffa::OwnedView<CreateAgentRequestView<'static>> {
5147 fn from(wrapper: CreateAgentRequestOwnedView) -> Self {
5148 wrapper.0
5149 }
5150 }
5151 impl ::core::convert::AsRef<::buffa::OwnedView<CreateAgentRequestView<'static>>>
5152 for CreateAgentRequestOwnedView {
5153 fn as_ref(&self) -> &::buffa::OwnedView<CreateAgentRequestView<'static>> {
5154 &self.0
5155 }
5156 }
5157 impl ::buffa::HasMessageView for super::super::CreateAgentRequest {
5158 type View<'a> = CreateAgentRequestView<'a>;
5159 type ViewHandle = CreateAgentRequestOwnedView;
5160 }
5161 impl ::serde::Serialize for CreateAgentRequestOwnedView {
5162 fn serialize<__S: ::serde::Serializer>(
5163 &self,
5164 __s: __S,
5165 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5166 ::serde::Serialize::serialize(&self.0, __s)
5167 }
5168 }
5169 #[derive(Clone, Debug, Default)]
5170 pub struct GetAgentRequestView<'a> {
5171 pub name: &'a str,
5175 pub include_browse: ::core::option::Option<bool>,
5180 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
5181 }
5182 impl<'a> GetAgentRequestView<'a> {
5183 #[doc(hidden)]
5191 pub fn _decode_depth(
5192 buf: &'a [u8],
5193 depth: u32,
5194 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5195 let mut view = Self::default();
5196 view._merge_into_view(buf, depth)?;
5197 ::core::result::Result::Ok(view)
5198 }
5199 #[doc(hidden)]
5207 pub fn _merge_into_view(
5208 &mut self,
5209 buf: &'a [u8],
5210 depth: u32,
5211 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5212 let _ = depth;
5213 #[allow(unused_variables)]
5214 let view = self;
5215 let mut cur: &'a [u8] = buf;
5216 while !cur.is_empty() {
5217 let before_tag = cur;
5218 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
5219 match tag.field_number() {
5220 1u32 => {
5221 if tag.wire_type()
5222 != ::buffa::encoding::WireType::LengthDelimited
5223 {
5224 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5225 field_number: 1u32,
5226 expected: 2u8,
5227 actual: tag.wire_type() as u8,
5228 });
5229 }
5230 view.name = ::buffa::types::borrow_str(&mut cur)?;
5231 }
5232 1005u32 => {
5233 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
5234 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5235 field_number: 1005u32,
5236 expected: 0u8,
5237 actual: tag.wire_type() as u8,
5238 });
5239 }
5240 view.include_browse = Some(
5241 ::buffa::types::decode_bool(&mut cur)?,
5242 );
5243 }
5244 _ => {
5245 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
5246 let span_len = before_tag.len() - cur.len();
5247 view.__buffa_unknown_fields
5248 .push_raw(&before_tag[..span_len]);
5249 }
5250 }
5251 }
5252 ::core::result::Result::Ok(())
5253 }
5254 }
5255 impl<'a> ::buffa::MessageView<'a> for GetAgentRequestView<'a> {
5256 type Owned = super::super::GetAgentRequest;
5257 fn decode_view(
5258 buf: &'a [u8],
5259 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5260 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
5261 }
5262 fn decode_view_with_limit(
5263 buf: &'a [u8],
5264 depth: u32,
5265 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5266 Self::_decode_depth(buf, depth)
5267 }
5268 fn to_owned_message(&self) -> super::super::GetAgentRequest {
5269 self.to_owned_from_source(None)
5270 }
5271 #[allow(clippy::useless_conversion, clippy::needless_update)]
5272 fn to_owned_from_source(
5273 &self,
5274 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
5275 ) -> super::super::GetAgentRequest {
5276 #[allow(unused_imports)]
5277 use ::buffa::alloc::string::ToString as _;
5278 let _ = __buffa_src;
5279 super::super::GetAgentRequest {
5280 name: self.name.to_string(),
5281 include_browse: self.include_browse,
5282 __buffa_unknown_fields: self
5283 .__buffa_unknown_fields
5284 .to_owned()
5285 .unwrap_or_default()
5286 .into(),
5287 ..::core::default::Default::default()
5288 }
5289 }
5290 }
5291 impl<'a> ::buffa::ViewEncode<'a> for GetAgentRequestView<'a> {
5292 #[allow(clippy::needless_borrow, clippy::let_and_return)]
5293 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5294 #[allow(unused_imports)]
5295 use ::buffa::Enumeration as _;
5296 let mut size = 0u32;
5297 if !self.name.is_empty() {
5298 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
5299 }
5300 if self.include_browse.is_some() {
5301 size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
5302 }
5303 size += self.__buffa_unknown_fields.encoded_len() as u32;
5304 size
5305 }
5306 #[allow(clippy::needless_borrow)]
5307 fn write_to(
5308 &self,
5309 _cache: &mut ::buffa::SizeCache,
5310 buf: &mut impl ::buffa::bytes::BufMut,
5311 ) {
5312 #[allow(unused_imports)]
5313 use ::buffa::Enumeration as _;
5314 if !self.name.is_empty() {
5315 ::buffa::encoding::Tag::new(
5316 1u32,
5317 ::buffa::encoding::WireType::LengthDelimited,
5318 )
5319 .encode(buf);
5320 ::buffa::types::encode_string(&self.name, buf);
5321 }
5322 if let Some(v) = self.include_browse {
5323 ::buffa::encoding::Tag::new(
5324 1005u32,
5325 ::buffa::encoding::WireType::Varint,
5326 )
5327 .encode(buf);
5328 ::buffa::types::encode_bool(v, buf);
5329 }
5330 self.__buffa_unknown_fields.write_to(buf);
5331 }
5332 }
5333 impl<'__a> ::serde::Serialize for GetAgentRequestView<'__a> {
5345 fn serialize<__S: ::serde::Serializer>(
5346 &self,
5347 __s: __S,
5348 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5349 use ::serde::ser::SerializeMap as _;
5350 let mut __map = __s.serialize_map(::core::option::Option::None)?;
5351 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
5352 __map.serialize_entry("name", self.name)?;
5353 }
5354 if let ::core::option::Option::Some(__v) = self.include_browse {
5355 __map.serialize_entry("include_browse", &__v)?;
5356 }
5357 __map.end()
5358 }
5359 }
5360 impl<'a> ::buffa::MessageName for GetAgentRequestView<'a> {
5361 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
5362 const NAME: &'static str = "GetAgentRequest";
5363 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.GetAgentRequest";
5364 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.GetAgentRequest";
5365 }
5366 impl<'v> ::buffa::DefaultViewInstance for GetAgentRequestView<'v> {
5367 fn default_view_instance<'a>() -> &'a Self
5368 where
5369 Self: 'a,
5370 {
5371 static VALUE: ::buffa::__private::OnceBox<
5372 GetAgentRequestView<'static>,
5373 > = ::buffa::__private::OnceBox::new();
5374 VALUE
5375 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
5376 <GetAgentRequestView<'static>>::default(),
5377 ))
5378 }
5379 }
5380 impl ::buffa::ViewReborrow for GetAgentRequestView<'static> {
5381 type Reborrowed<'b> = GetAgentRequestView<'b>;
5382 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
5383 this
5384 }
5385 }
5386 #[derive(Clone, Debug)]
5392 pub struct GetAgentRequestOwnedView(
5393 ::buffa::OwnedView<GetAgentRequestView<'static>>,
5394 );
5395 impl GetAgentRequestOwnedView {
5396 pub fn decode(
5406 bytes: ::buffa::bytes::Bytes,
5407 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5408 ::core::result::Result::Ok(
5409 GetAgentRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
5410 )
5411 }
5412 pub fn decode_with_options(
5420 bytes: ::buffa::bytes::Bytes,
5421 opts: &::buffa::DecodeOptions,
5422 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5423 ::core::result::Result::Ok(
5424 GetAgentRequestOwnedView(
5425 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5426 ),
5427 )
5428 }
5429 pub fn from_owned(
5436 msg: &super::super::GetAgentRequest,
5437 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5438 ::core::result::Result::Ok(
5439 GetAgentRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
5440 )
5441 }
5442 #[must_use]
5444 pub fn view(&self) -> &GetAgentRequestView<'_> {
5445 self.0.reborrow()
5446 }
5447 #[must_use]
5449 pub fn to_owned_message(&self) -> super::super::GetAgentRequest {
5450 self.0.to_owned_message()
5451 }
5452 #[must_use]
5454 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5455 self.0.bytes()
5456 }
5457 #[must_use]
5459 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5460 self.0.into_bytes()
5461 }
5462 #[must_use]
5466 pub fn name(&self) -> &'_ str {
5467 self.0.reborrow().name
5468 }
5469 #[must_use]
5474 pub fn include_browse(&self) -> ::core::option::Option<bool> {
5475 self.0.reborrow().include_browse
5476 }
5477 }
5478 impl ::core::convert::From<::buffa::OwnedView<GetAgentRequestView<'static>>>
5479 for GetAgentRequestOwnedView {
5480 fn from(inner: ::buffa::OwnedView<GetAgentRequestView<'static>>) -> Self {
5481 GetAgentRequestOwnedView(inner)
5482 }
5483 }
5484 impl ::core::convert::From<GetAgentRequestOwnedView>
5485 for ::buffa::OwnedView<GetAgentRequestView<'static>> {
5486 fn from(wrapper: GetAgentRequestOwnedView) -> Self {
5487 wrapper.0
5488 }
5489 }
5490 impl ::core::convert::AsRef<::buffa::OwnedView<GetAgentRequestView<'static>>>
5491 for GetAgentRequestOwnedView {
5492 fn as_ref(&self) -> &::buffa::OwnedView<GetAgentRequestView<'static>> {
5493 &self.0
5494 }
5495 }
5496 impl ::buffa::HasMessageView for super::super::GetAgentRequest {
5497 type View<'a> = GetAgentRequestView<'a>;
5498 type ViewHandle = GetAgentRequestOwnedView;
5499 }
5500 impl ::serde::Serialize for GetAgentRequestOwnedView {
5501 fn serialize<__S: ::serde::Serializer>(
5502 &self,
5503 __s: __S,
5504 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5505 ::serde::Serialize::serialize(&self.0, __s)
5506 }
5507 }
5508 #[derive(Clone, Debug, Default)]
5509 pub struct UpdateAgentRequestView<'a> {
5510 pub name: &'a str,
5514 pub new_name: ::core::option::Option<&'a str>,
5518 pub invocation_protocol: ::core::option::Option<
5522 ::buffa::EnumValue<super::super::InvocationProtocol>,
5523 >,
5524 pub endpoint: ::core::option::Option<&'a str>,
5528 pub description: ::core::option::Option<&'a str>,
5532 pub capabilities: ::buffa::RepeatedView<'a, &'a str>,
5536 pub input_schema: ::core::option::Option<&'a str>,
5540 pub comment: ::core::option::Option<&'a str>,
5544 pub owner: ::core::option::Option<&'a str>,
5548 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
5549 }
5550 impl<'a> UpdateAgentRequestView<'a> {
5551 #[doc(hidden)]
5559 pub fn _decode_depth(
5560 buf: &'a [u8],
5561 depth: u32,
5562 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5563 let mut view = Self::default();
5564 view._merge_into_view(buf, depth)?;
5565 ::core::result::Result::Ok(view)
5566 }
5567 #[doc(hidden)]
5575 pub fn _merge_into_view(
5576 &mut self,
5577 buf: &'a [u8],
5578 depth: u32,
5579 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5580 let _ = depth;
5581 #[allow(unused_variables)]
5582 let view = self;
5583 let mut cur: &'a [u8] = buf;
5584 while !cur.is_empty() {
5585 let before_tag = cur;
5586 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
5587 match tag.field_number() {
5588 1u32 => {
5589 if tag.wire_type()
5590 != ::buffa::encoding::WireType::LengthDelimited
5591 {
5592 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5593 field_number: 1u32,
5594 expected: 2u8,
5595 actual: tag.wire_type() as u8,
5596 });
5597 }
5598 view.name = ::buffa::types::borrow_str(&mut cur)?;
5599 }
5600 2u32 => {
5601 if tag.wire_type()
5602 != ::buffa::encoding::WireType::LengthDelimited
5603 {
5604 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5605 field_number: 2u32,
5606 expected: 2u8,
5607 actual: tag.wire_type() as u8,
5608 });
5609 }
5610 view.new_name = Some(::buffa::types::borrow_str(&mut cur)?);
5611 }
5612 3u32 => {
5613 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
5614 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5615 field_number: 3u32,
5616 expected: 0u8,
5617 actual: tag.wire_type() as u8,
5618 });
5619 }
5620 view.invocation_protocol = Some(
5621 ::buffa::EnumValue::from(
5622 ::buffa::types::decode_int32(&mut cur)?,
5623 ),
5624 );
5625 }
5626 4u32 => {
5627 if tag.wire_type()
5628 != ::buffa::encoding::WireType::LengthDelimited
5629 {
5630 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5631 field_number: 4u32,
5632 expected: 2u8,
5633 actual: tag.wire_type() as u8,
5634 });
5635 }
5636 view.endpoint = Some(::buffa::types::borrow_str(&mut cur)?);
5637 }
5638 5u32 => {
5639 if tag.wire_type()
5640 != ::buffa::encoding::WireType::LengthDelimited
5641 {
5642 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5643 field_number: 5u32,
5644 expected: 2u8,
5645 actual: tag.wire_type() as u8,
5646 });
5647 }
5648 view.description = Some(
5649 ::buffa::types::borrow_str(&mut cur)?,
5650 );
5651 }
5652 7u32 => {
5653 if tag.wire_type()
5654 != ::buffa::encoding::WireType::LengthDelimited
5655 {
5656 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5657 field_number: 7u32,
5658 expected: 2u8,
5659 actual: tag.wire_type() as u8,
5660 });
5661 }
5662 view.input_schema = Some(
5663 ::buffa::types::borrow_str(&mut cur)?,
5664 );
5665 }
5666 8u32 => {
5667 if tag.wire_type()
5668 != ::buffa::encoding::WireType::LengthDelimited
5669 {
5670 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5671 field_number: 8u32,
5672 expected: 2u8,
5673 actual: tag.wire_type() as u8,
5674 });
5675 }
5676 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
5677 }
5678 9u32 => {
5679 if tag.wire_type()
5680 != ::buffa::encoding::WireType::LengthDelimited
5681 {
5682 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5683 field_number: 9u32,
5684 expected: 2u8,
5685 actual: tag.wire_type() as u8,
5686 });
5687 }
5688 view.owner = Some(::buffa::types::borrow_str(&mut cur)?);
5689 }
5690 6u32 => {
5691 if tag.wire_type()
5692 != ::buffa::encoding::WireType::LengthDelimited
5693 {
5694 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5695 field_number: 6u32,
5696 expected: 2u8,
5697 actual: tag.wire_type() as u8,
5698 });
5699 }
5700 view.capabilities
5701 .push(::buffa::types::borrow_str(&mut cur)?);
5702 }
5703 _ => {
5704 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
5705 let span_len = before_tag.len() - cur.len();
5706 view.__buffa_unknown_fields
5707 .push_raw(&before_tag[..span_len]);
5708 }
5709 }
5710 }
5711 ::core::result::Result::Ok(())
5712 }
5713 }
5714 impl<'a> ::buffa::MessageView<'a> for UpdateAgentRequestView<'a> {
5715 type Owned = super::super::UpdateAgentRequest;
5716 fn decode_view(
5717 buf: &'a [u8],
5718 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5719 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
5720 }
5721 fn decode_view_with_limit(
5722 buf: &'a [u8],
5723 depth: u32,
5724 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5725 Self::_decode_depth(buf, depth)
5726 }
5727 fn to_owned_message(&self) -> super::super::UpdateAgentRequest {
5728 self.to_owned_from_source(None)
5729 }
5730 #[allow(clippy::useless_conversion, clippy::needless_update)]
5731 fn to_owned_from_source(
5732 &self,
5733 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
5734 ) -> super::super::UpdateAgentRequest {
5735 #[allow(unused_imports)]
5736 use ::buffa::alloc::string::ToString as _;
5737 let _ = __buffa_src;
5738 super::super::UpdateAgentRequest {
5739 name: self.name.to_string(),
5740 new_name: self.new_name.map(|s| s.to_string()),
5741 invocation_protocol: self.invocation_protocol,
5742 endpoint: self.endpoint.map(|s| s.to_string()),
5743 description: self.description.map(|s| s.to_string()),
5744 capabilities: self
5745 .capabilities
5746 .iter()
5747 .map(|s| s.to_string())
5748 .collect(),
5749 input_schema: self.input_schema.map(|s| s.to_string()),
5750 comment: self.comment.map(|s| s.to_string()),
5751 owner: self.owner.map(|s| s.to_string()),
5752 __buffa_unknown_fields: self
5753 .__buffa_unknown_fields
5754 .to_owned()
5755 .unwrap_or_default()
5756 .into(),
5757 ..::core::default::Default::default()
5758 }
5759 }
5760 }
5761 impl<'a> ::buffa::ViewEncode<'a> for UpdateAgentRequestView<'a> {
5762 #[allow(clippy::needless_borrow, clippy::let_and_return)]
5763 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5764 #[allow(unused_imports)]
5765 use ::buffa::Enumeration as _;
5766 let mut size = 0u32;
5767 if !self.name.is_empty() {
5768 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
5769 }
5770 if let Some(ref v) = self.new_name {
5771 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5772 }
5773 if let Some(ref v) = self.invocation_protocol {
5774 size += 1u32 + ::buffa::types::int32_encoded_len(v.to_i32()) as u32;
5775 }
5776 if let Some(ref v) = self.endpoint {
5777 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5778 }
5779 if let Some(ref v) = self.description {
5780 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5781 }
5782 for v in &self.capabilities {
5783 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5784 }
5785 if let Some(ref v) = self.input_schema {
5786 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5787 }
5788 if let Some(ref v) = self.comment {
5789 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5790 }
5791 if let Some(ref v) = self.owner {
5792 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5793 }
5794 size += self.__buffa_unknown_fields.encoded_len() as u32;
5795 size
5796 }
5797 #[allow(clippy::needless_borrow)]
5798 fn write_to(
5799 &self,
5800 _cache: &mut ::buffa::SizeCache,
5801 buf: &mut impl ::buffa::bytes::BufMut,
5802 ) {
5803 #[allow(unused_imports)]
5804 use ::buffa::Enumeration as _;
5805 if !self.name.is_empty() {
5806 ::buffa::encoding::Tag::new(
5807 1u32,
5808 ::buffa::encoding::WireType::LengthDelimited,
5809 )
5810 .encode(buf);
5811 ::buffa::types::encode_string(&self.name, buf);
5812 }
5813 if let Some(ref v) = self.new_name {
5814 ::buffa::encoding::Tag::new(
5815 2u32,
5816 ::buffa::encoding::WireType::LengthDelimited,
5817 )
5818 .encode(buf);
5819 ::buffa::types::encode_string(v, buf);
5820 }
5821 if let Some(ref v) = self.invocation_protocol {
5822 ::buffa::encoding::Tag::new(
5823 3u32,
5824 ::buffa::encoding::WireType::Varint,
5825 )
5826 .encode(buf);
5827 ::buffa::types::encode_int32(v.to_i32(), buf);
5828 }
5829 if let Some(ref v) = self.endpoint {
5830 ::buffa::encoding::Tag::new(
5831 4u32,
5832 ::buffa::encoding::WireType::LengthDelimited,
5833 )
5834 .encode(buf);
5835 ::buffa::types::encode_string(v, buf);
5836 }
5837 if let Some(ref v) = self.description {
5838 ::buffa::encoding::Tag::new(
5839 5u32,
5840 ::buffa::encoding::WireType::LengthDelimited,
5841 )
5842 .encode(buf);
5843 ::buffa::types::encode_string(v, buf);
5844 }
5845 for v in &self.capabilities {
5846 ::buffa::encoding::Tag::new(
5847 6u32,
5848 ::buffa::encoding::WireType::LengthDelimited,
5849 )
5850 .encode(buf);
5851 ::buffa::types::encode_string(v, buf);
5852 }
5853 if let Some(ref v) = self.input_schema {
5854 ::buffa::encoding::Tag::new(
5855 7u32,
5856 ::buffa::encoding::WireType::LengthDelimited,
5857 )
5858 .encode(buf);
5859 ::buffa::types::encode_string(v, buf);
5860 }
5861 if let Some(ref v) = self.comment {
5862 ::buffa::encoding::Tag::new(
5863 8u32,
5864 ::buffa::encoding::WireType::LengthDelimited,
5865 )
5866 .encode(buf);
5867 ::buffa::types::encode_string(v, buf);
5868 }
5869 if let Some(ref v) = self.owner {
5870 ::buffa::encoding::Tag::new(
5871 9u32,
5872 ::buffa::encoding::WireType::LengthDelimited,
5873 )
5874 .encode(buf);
5875 ::buffa::types::encode_string(v, buf);
5876 }
5877 self.__buffa_unknown_fields.write_to(buf);
5878 }
5879 }
5880 impl<'__a> ::serde::Serialize for UpdateAgentRequestView<'__a> {
5892 fn serialize<__S: ::serde::Serializer>(
5893 &self,
5894 __s: __S,
5895 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5896 use ::serde::ser::SerializeMap as _;
5897 let mut __map = __s.serialize_map(::core::option::Option::None)?;
5898 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
5899 __map.serialize_entry("name", self.name)?;
5900 }
5901 if let ::core::option::Option::Some(__v) = self.new_name {
5902 __map.serialize_entry("new_name", __v)?;
5903 }
5904 if let ::core::option::Option::Some(ref __v) = self.invocation_protocol {
5905 __map.serialize_entry("invocation_protocol", __v)?;
5906 }
5907 if let ::core::option::Option::Some(__v) = self.endpoint {
5908 __map.serialize_entry("endpoint", __v)?;
5909 }
5910 if let ::core::option::Option::Some(__v) = self.description {
5911 __map.serialize_entry("description", __v)?;
5912 }
5913 if !self.capabilities.is_empty() {
5914 __map.serialize_entry("capabilities", &*self.capabilities)?;
5915 }
5916 if let ::core::option::Option::Some(__v) = self.input_schema {
5917 __map.serialize_entry("input_schema", __v)?;
5918 }
5919 if let ::core::option::Option::Some(__v) = self.comment {
5920 __map.serialize_entry("comment", __v)?;
5921 }
5922 if let ::core::option::Option::Some(__v) = self.owner {
5923 __map.serialize_entry("owner", __v)?;
5924 }
5925 __map.end()
5926 }
5927 }
5928 impl<'a> ::buffa::MessageName for UpdateAgentRequestView<'a> {
5929 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
5930 const NAME: &'static str = "UpdateAgentRequest";
5931 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.UpdateAgentRequest";
5932 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.UpdateAgentRequest";
5933 }
5934 impl<'v> ::buffa::DefaultViewInstance for UpdateAgentRequestView<'v> {
5935 fn default_view_instance<'a>() -> &'a Self
5936 where
5937 Self: 'a,
5938 {
5939 static VALUE: ::buffa::__private::OnceBox<
5940 UpdateAgentRequestView<'static>,
5941 > = ::buffa::__private::OnceBox::new();
5942 VALUE
5943 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
5944 <UpdateAgentRequestView<'static>>::default(),
5945 ))
5946 }
5947 }
5948 impl ::buffa::ViewReborrow for UpdateAgentRequestView<'static> {
5949 type Reborrowed<'b> = UpdateAgentRequestView<'b>;
5950 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
5951 this
5952 }
5953 }
5954 #[derive(Clone, Debug)]
5960 pub struct UpdateAgentRequestOwnedView(
5961 ::buffa::OwnedView<UpdateAgentRequestView<'static>>,
5962 );
5963 impl UpdateAgentRequestOwnedView {
5964 pub fn decode(
5974 bytes: ::buffa::bytes::Bytes,
5975 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5976 ::core::result::Result::Ok(
5977 UpdateAgentRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
5978 )
5979 }
5980 pub fn decode_with_options(
5988 bytes: ::buffa::bytes::Bytes,
5989 opts: &::buffa::DecodeOptions,
5990 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5991 ::core::result::Result::Ok(
5992 UpdateAgentRequestOwnedView(
5993 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5994 ),
5995 )
5996 }
5997 pub fn from_owned(
6004 msg: &super::super::UpdateAgentRequest,
6005 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6006 ::core::result::Result::Ok(
6007 UpdateAgentRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
6008 )
6009 }
6010 #[must_use]
6012 pub fn view(&self) -> &UpdateAgentRequestView<'_> {
6013 self.0.reborrow()
6014 }
6015 #[must_use]
6017 pub fn to_owned_message(&self) -> super::super::UpdateAgentRequest {
6018 self.0.to_owned_message()
6019 }
6020 #[must_use]
6022 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
6023 self.0.bytes()
6024 }
6025 #[must_use]
6027 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
6028 self.0.into_bytes()
6029 }
6030 #[must_use]
6034 pub fn name(&self) -> &'_ str {
6035 self.0.reborrow().name
6036 }
6037 #[must_use]
6041 pub fn new_name(&self) -> ::core::option::Option<&'_ str> {
6042 self.0.reborrow().new_name
6043 }
6044 #[must_use]
6048 pub fn invocation_protocol(
6049 &self,
6050 ) -> ::core::option::Option<
6051 ::buffa::EnumValue<super::super::InvocationProtocol>,
6052 > {
6053 self.0.reborrow().invocation_protocol
6054 }
6055 #[must_use]
6059 pub fn endpoint(&self) -> ::core::option::Option<&'_ str> {
6060 self.0.reborrow().endpoint
6061 }
6062 #[must_use]
6066 pub fn description(&self) -> ::core::option::Option<&'_ str> {
6067 self.0.reborrow().description
6068 }
6069 #[must_use]
6073 pub fn capabilities(&self) -> &::buffa::RepeatedView<'_, &'_ str> {
6074 &self.0.reborrow().capabilities
6075 }
6076 #[must_use]
6080 pub fn input_schema(&self) -> ::core::option::Option<&'_ str> {
6081 self.0.reborrow().input_schema
6082 }
6083 #[must_use]
6087 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
6088 self.0.reborrow().comment
6089 }
6090 #[must_use]
6094 pub fn owner(&self) -> ::core::option::Option<&'_ str> {
6095 self.0.reborrow().owner
6096 }
6097 }
6098 impl ::core::convert::From<::buffa::OwnedView<UpdateAgentRequestView<'static>>>
6099 for UpdateAgentRequestOwnedView {
6100 fn from(inner: ::buffa::OwnedView<UpdateAgentRequestView<'static>>) -> Self {
6101 UpdateAgentRequestOwnedView(inner)
6102 }
6103 }
6104 impl ::core::convert::From<UpdateAgentRequestOwnedView>
6105 for ::buffa::OwnedView<UpdateAgentRequestView<'static>> {
6106 fn from(wrapper: UpdateAgentRequestOwnedView) -> Self {
6107 wrapper.0
6108 }
6109 }
6110 impl ::core::convert::AsRef<::buffa::OwnedView<UpdateAgentRequestView<'static>>>
6111 for UpdateAgentRequestOwnedView {
6112 fn as_ref(&self) -> &::buffa::OwnedView<UpdateAgentRequestView<'static>> {
6113 &self.0
6114 }
6115 }
6116 impl ::buffa::HasMessageView for super::super::UpdateAgentRequest {
6117 type View<'a> = UpdateAgentRequestView<'a>;
6118 type ViewHandle = UpdateAgentRequestOwnedView;
6119 }
6120 impl ::serde::Serialize for UpdateAgentRequestOwnedView {
6121 fn serialize<__S: ::serde::Serializer>(
6122 &self,
6123 __s: __S,
6124 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6125 ::serde::Serialize::serialize(&self.0, __s)
6126 }
6127 }
6128 #[derive(Clone, Debug, Default)]
6129 pub struct DeleteAgentRequestView<'a> {
6130 pub name: &'a str,
6134 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
6135 }
6136 impl<'a> DeleteAgentRequestView<'a> {
6137 #[doc(hidden)]
6145 pub fn _decode_depth(
6146 buf: &'a [u8],
6147 depth: u32,
6148 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6149 let mut view = Self::default();
6150 view._merge_into_view(buf, depth)?;
6151 ::core::result::Result::Ok(view)
6152 }
6153 #[doc(hidden)]
6161 pub fn _merge_into_view(
6162 &mut self,
6163 buf: &'a [u8],
6164 depth: u32,
6165 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6166 let _ = depth;
6167 #[allow(unused_variables)]
6168 let view = self;
6169 let mut cur: &'a [u8] = buf;
6170 while !cur.is_empty() {
6171 let before_tag = cur;
6172 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
6173 match tag.field_number() {
6174 1u32 => {
6175 if tag.wire_type()
6176 != ::buffa::encoding::WireType::LengthDelimited
6177 {
6178 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6179 field_number: 1u32,
6180 expected: 2u8,
6181 actual: tag.wire_type() as u8,
6182 });
6183 }
6184 view.name = ::buffa::types::borrow_str(&mut cur)?;
6185 }
6186 _ => {
6187 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
6188 let span_len = before_tag.len() - cur.len();
6189 view.__buffa_unknown_fields
6190 .push_raw(&before_tag[..span_len]);
6191 }
6192 }
6193 }
6194 ::core::result::Result::Ok(())
6195 }
6196 }
6197 impl<'a> ::buffa::MessageView<'a> for DeleteAgentRequestView<'a> {
6198 type Owned = super::super::DeleteAgentRequest;
6199 fn decode_view(
6200 buf: &'a [u8],
6201 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6202 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
6203 }
6204 fn decode_view_with_limit(
6205 buf: &'a [u8],
6206 depth: u32,
6207 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6208 Self::_decode_depth(buf, depth)
6209 }
6210 fn to_owned_message(&self) -> super::super::DeleteAgentRequest {
6211 self.to_owned_from_source(None)
6212 }
6213 #[allow(clippy::useless_conversion, clippy::needless_update)]
6214 fn to_owned_from_source(
6215 &self,
6216 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
6217 ) -> super::super::DeleteAgentRequest {
6218 #[allow(unused_imports)]
6219 use ::buffa::alloc::string::ToString as _;
6220 let _ = __buffa_src;
6221 super::super::DeleteAgentRequest {
6222 name: self.name.to_string(),
6223 __buffa_unknown_fields: self
6224 .__buffa_unknown_fields
6225 .to_owned()
6226 .unwrap_or_default()
6227 .into(),
6228 ..::core::default::Default::default()
6229 }
6230 }
6231 }
6232 impl<'a> ::buffa::ViewEncode<'a> for DeleteAgentRequestView<'a> {
6233 #[allow(clippy::needless_borrow, clippy::let_and_return)]
6234 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
6235 #[allow(unused_imports)]
6236 use ::buffa::Enumeration as _;
6237 let mut size = 0u32;
6238 if !self.name.is_empty() {
6239 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
6240 }
6241 size += self.__buffa_unknown_fields.encoded_len() as u32;
6242 size
6243 }
6244 #[allow(clippy::needless_borrow)]
6245 fn write_to(
6246 &self,
6247 _cache: &mut ::buffa::SizeCache,
6248 buf: &mut impl ::buffa::bytes::BufMut,
6249 ) {
6250 #[allow(unused_imports)]
6251 use ::buffa::Enumeration as _;
6252 if !self.name.is_empty() {
6253 ::buffa::encoding::Tag::new(
6254 1u32,
6255 ::buffa::encoding::WireType::LengthDelimited,
6256 )
6257 .encode(buf);
6258 ::buffa::types::encode_string(&self.name, buf);
6259 }
6260 self.__buffa_unknown_fields.write_to(buf);
6261 }
6262 }
6263 impl<'__a> ::serde::Serialize for DeleteAgentRequestView<'__a> {
6275 fn serialize<__S: ::serde::Serializer>(
6276 &self,
6277 __s: __S,
6278 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6279 use ::serde::ser::SerializeMap as _;
6280 let mut __map = __s.serialize_map(::core::option::Option::None)?;
6281 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
6282 __map.serialize_entry("name", self.name)?;
6283 }
6284 __map.end()
6285 }
6286 }
6287 impl<'a> ::buffa::MessageName for DeleteAgentRequestView<'a> {
6288 const PACKAGE: &'static str = "unitycatalog.agents.v0alpha1";
6289 const NAME: &'static str = "DeleteAgentRequest";
6290 const FULL_NAME: &'static str = "unitycatalog.agents.v0alpha1.DeleteAgentRequest";
6291 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agents.v0alpha1.DeleteAgentRequest";
6292 }
6293 impl<'v> ::buffa::DefaultViewInstance for DeleteAgentRequestView<'v> {
6294 fn default_view_instance<'a>() -> &'a Self
6295 where
6296 Self: 'a,
6297 {
6298 static VALUE: ::buffa::__private::OnceBox<
6299 DeleteAgentRequestView<'static>,
6300 > = ::buffa::__private::OnceBox::new();
6301 VALUE
6302 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
6303 <DeleteAgentRequestView<'static>>::default(),
6304 ))
6305 }
6306 }
6307 impl ::buffa::ViewReborrow for DeleteAgentRequestView<'static> {
6308 type Reborrowed<'b> = DeleteAgentRequestView<'b>;
6309 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
6310 this
6311 }
6312 }
6313 #[derive(Clone, Debug)]
6319 pub struct DeleteAgentRequestOwnedView(
6320 ::buffa::OwnedView<DeleteAgentRequestView<'static>>,
6321 );
6322 impl DeleteAgentRequestOwnedView {
6323 pub fn decode(
6333 bytes: ::buffa::bytes::Bytes,
6334 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6335 ::core::result::Result::Ok(
6336 DeleteAgentRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
6337 )
6338 }
6339 pub fn decode_with_options(
6347 bytes: ::buffa::bytes::Bytes,
6348 opts: &::buffa::DecodeOptions,
6349 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6350 ::core::result::Result::Ok(
6351 DeleteAgentRequestOwnedView(
6352 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
6353 ),
6354 )
6355 }
6356 pub fn from_owned(
6363 msg: &super::super::DeleteAgentRequest,
6364 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6365 ::core::result::Result::Ok(
6366 DeleteAgentRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
6367 )
6368 }
6369 #[must_use]
6371 pub fn view(&self) -> &DeleteAgentRequestView<'_> {
6372 self.0.reborrow()
6373 }
6374 #[must_use]
6376 pub fn to_owned_message(&self) -> super::super::DeleteAgentRequest {
6377 self.0.to_owned_message()
6378 }
6379 #[must_use]
6381 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
6382 self.0.bytes()
6383 }
6384 #[must_use]
6386 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
6387 self.0.into_bytes()
6388 }
6389 #[must_use]
6393 pub fn name(&self) -> &'_ str {
6394 self.0.reborrow().name
6395 }
6396 }
6397 impl ::core::convert::From<::buffa::OwnedView<DeleteAgentRequestView<'static>>>
6398 for DeleteAgentRequestOwnedView {
6399 fn from(inner: ::buffa::OwnedView<DeleteAgentRequestView<'static>>) -> Self {
6400 DeleteAgentRequestOwnedView(inner)
6401 }
6402 }
6403 impl ::core::convert::From<DeleteAgentRequestOwnedView>
6404 for ::buffa::OwnedView<DeleteAgentRequestView<'static>> {
6405 fn from(wrapper: DeleteAgentRequestOwnedView) -> Self {
6406 wrapper.0
6407 }
6408 }
6409 impl ::core::convert::AsRef<::buffa::OwnedView<DeleteAgentRequestView<'static>>>
6410 for DeleteAgentRequestOwnedView {
6411 fn as_ref(&self) -> &::buffa::OwnedView<DeleteAgentRequestView<'static>> {
6412 &self.0
6413 }
6414 }
6415 impl ::buffa::HasMessageView for super::super::DeleteAgentRequest {
6416 type View<'a> = DeleteAgentRequestView<'a>;
6417 type ViewHandle = DeleteAgentRequestOwnedView;
6418 }
6419 impl ::serde::Serialize for DeleteAgentRequestOwnedView {
6420 fn serialize<__S: ::serde::Serializer>(
6421 &self,
6422 __s: __S,
6423 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6424 ::serde::Serialize::serialize(&self.0, __s)
6425 }
6426 }
6427 }
6428 pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
6430 reg.register_json_any(super::__AGENT_JSON_ANY);
6431 reg.register_json_any(super::__LIST_AGENTS_REQUEST_JSON_ANY);
6432 reg.register_json_any(super::__LIST_AGENTS_RESPONSE_JSON_ANY);
6433 reg.register_json_any(super::__CREATE_AGENT_REQUEST_JSON_ANY);
6434 reg.register_json_any(super::__GET_AGENT_REQUEST_JSON_ANY);
6435 reg.register_json_any(super::__UPDATE_AGENT_REQUEST_JSON_ANY);
6436 reg.register_json_any(super::__DELETE_AGENT_REQUEST_JSON_ANY);
6437 }
6438}
6439#[doc(inline)]
6440pub use self::__buffa::view::AgentView;
6441#[doc(inline)]
6442pub use self::__buffa::view::AgentOwnedView;
6443#[doc(inline)]
6444pub use self::__buffa::view::ListAgentsRequestView;
6445#[doc(inline)]
6446pub use self::__buffa::view::ListAgentsRequestOwnedView;
6447#[doc(inline)]
6448pub use self::__buffa::view::ListAgentsResponseView;
6449#[doc(inline)]
6450pub use self::__buffa::view::ListAgentsResponseOwnedView;
6451#[doc(inline)]
6452pub use self::__buffa::view::CreateAgentRequestView;
6453#[doc(inline)]
6454pub use self::__buffa::view::CreateAgentRequestOwnedView;
6455#[doc(inline)]
6456pub use self::__buffa::view::GetAgentRequestView;
6457#[doc(inline)]
6458pub use self::__buffa::view::GetAgentRequestOwnedView;
6459#[doc(inline)]
6460pub use self::__buffa::view::UpdateAgentRequestView;
6461#[doc(inline)]
6462pub use self::__buffa::view::UpdateAgentRequestOwnedView;
6463#[doc(inline)]
6464pub use self::__buffa::view::DeleteAgentRequestView;
6465#[doc(inline)]
6466pub use self::__buffa::view::DeleteAgentRequestOwnedView;
6467#[doc(inline)]
6468pub use self::__buffa::register_types;