1#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
5#[repr(i32)]
6pub enum AgentSkillType {
7 AGENT_SKILL_TYPE_UNSPECIFIED = 0i32,
8 EXTERNAL = 1i32,
11 MANAGED = 2i32,
14}
15impl AgentSkillType {
16 #[allow(non_upper_case_globals)]
18 pub const AgentSkillTypeUnspecified: Self = Self::AGENT_SKILL_TYPE_UNSPECIFIED;
19 #[allow(non_upper_case_globals)]
21 pub const External: Self = Self::EXTERNAL;
22 #[allow(non_upper_case_globals)]
24 pub const Managed: Self = Self::MANAGED;
25}
26impl ::core::default::Default for AgentSkillType {
27 fn default() -> Self {
28 Self::AGENT_SKILL_TYPE_UNSPECIFIED
29 }
30}
31impl ::serde::Serialize for AgentSkillType {
32 fn serialize<S: ::serde::Serializer>(
33 &self,
34 s: S,
35 ) -> ::core::result::Result<S::Ok, S::Error> {
36 s.serialize_str(::buffa::Enumeration::proto_name(self))
37 }
38}
39impl<'de> ::serde::Deserialize<'de> for AgentSkillType {
40 fn deserialize<D: ::serde::Deserializer<'de>>(
41 d: D,
42 ) -> ::core::result::Result<Self, D::Error> {
43 struct _V;
44 impl ::serde::de::Visitor<'_> for _V {
45 type Value = AgentSkillType;
46 fn expecting(
47 &self,
48 f: &mut ::core::fmt::Formatter<'_>,
49 ) -> ::core::fmt::Result {
50 f.write_str(
51 concat!(
52 "a string, integer, or null for ", stringify!(AgentSkillType)
53 ),
54 )
55 }
56 fn visit_str<E: ::serde::de::Error>(
57 self,
58 v: &str,
59 ) -> ::core::result::Result<AgentSkillType, E> {
60 <AgentSkillType as ::buffa::Enumeration>::from_proto_name(v)
61 .ok_or_else(|| { ::serde::de::Error::unknown_variant(v, &[]) })
62 }
63 fn visit_i64<E: ::serde::de::Error>(
64 self,
65 v: i64,
66 ) -> ::core::result::Result<AgentSkillType, E> {
67 let v32 = i32::try_from(v)
68 .map_err(|_| {
69 ::serde::de::Error::custom(
70 ::buffa::alloc::format!("enum value {v} out of i32 range"),
71 )
72 })?;
73 <AgentSkillType as ::buffa::Enumeration>::from_i32(v32)
74 .ok_or_else(|| {
75 ::serde::de::Error::custom(
76 ::buffa::alloc::format!("unknown enum value {v32}"),
77 )
78 })
79 }
80 fn visit_u64<E: ::serde::de::Error>(
81 self,
82 v: u64,
83 ) -> ::core::result::Result<AgentSkillType, E> {
84 let v32 = i32::try_from(v)
85 .map_err(|_| {
86 ::serde::de::Error::custom(
87 ::buffa::alloc::format!("enum value {v} out of i32 range"),
88 )
89 })?;
90 <AgentSkillType as ::buffa::Enumeration>::from_i32(v32)
91 .ok_or_else(|| {
92 ::serde::de::Error::custom(
93 ::buffa::alloc::format!("unknown enum value {v32}"),
94 )
95 })
96 }
97 fn visit_unit<E: ::serde::de::Error>(
98 self,
99 ) -> ::core::result::Result<AgentSkillType, E> {
100 ::core::result::Result::Ok(::core::default::Default::default())
101 }
102 }
103 d.deserialize_any(_V)
104 }
105}
106impl ::buffa::json_helpers::ProtoElemJson for AgentSkillType {
107 fn serialize_proto_json<S: ::serde::Serializer>(
108 v: &Self,
109 s: S,
110 ) -> ::core::result::Result<S::Ok, S::Error> {
111 ::serde::Serialize::serialize(v, s)
112 }
113 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
114 d: D,
115 ) -> ::core::result::Result<Self, D::Error> {
116 <Self as ::serde::Deserialize>::deserialize(d)
117 }
118}
119impl ::buffa::Enumeration for AgentSkillType {
120 fn from_i32(value: i32) -> ::core::option::Option<Self> {
121 match value {
122 0i32 => ::core::option::Option::Some(Self::AGENT_SKILL_TYPE_UNSPECIFIED),
123 1i32 => ::core::option::Option::Some(Self::EXTERNAL),
124 2i32 => ::core::option::Option::Some(Self::MANAGED),
125 _ => ::core::option::Option::None,
126 }
127 }
128 fn to_i32(&self) -> i32 {
129 *self as i32
130 }
131 fn proto_name(&self) -> &'static str {
132 match self {
133 Self::AGENT_SKILL_TYPE_UNSPECIFIED => "AGENT_SKILL_TYPE_UNSPECIFIED",
134 Self::EXTERNAL => "EXTERNAL",
135 Self::MANAGED => "MANAGED",
136 }
137 }
138 fn from_proto_name(name: &str) -> ::core::option::Option<Self> {
139 match name {
140 "AGENT_SKILL_TYPE_UNSPECIFIED" => {
141 ::core::option::Option::Some(Self::AGENT_SKILL_TYPE_UNSPECIFIED)
142 }
143 "EXTERNAL" => ::core::option::Option::Some(Self::EXTERNAL),
144 "MANAGED" => ::core::option::Option::Some(Self::MANAGED),
145 _ => ::core::option::Option::None,
146 }
147 }
148 fn values() -> &'static [Self] {
149 &[Self::AGENT_SKILL_TYPE_UNSPECIFIED, Self::EXTERNAL, Self::MANAGED]
150 }
151}
152#[derive(Clone, PartialEq, Default)]
154#[derive(::serde::Serialize, ::serde::Deserialize)]
155#[serde(default)]
156pub struct AgentSkill {
157 #[serde(
166 rename = "name",
167 with = "::buffa::json_helpers::proto_string",
168 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
169 )]
170 pub name: ::buffa::alloc::string::String,
171 #[serde(
175 rename = "catalog_name",
176 alias = "catalogName",
177 with = "::buffa::json_helpers::proto_string",
178 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
179 )]
180 pub catalog_name: ::buffa::alloc::string::String,
181 #[serde(
185 rename = "schema_name",
186 alias = "schemaName",
187 with = "::buffa::json_helpers::proto_string",
188 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
189 )]
190 pub schema_name: ::buffa::alloc::string::String,
191 #[serde(
195 rename = "full_name",
196 alias = "fullName",
197 with = "::buffa::json_helpers::proto_string",
198 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
199 )]
200 pub full_name: ::buffa::alloc::string::String,
201 #[serde(
206 rename = "storage_location",
207 alias = "storageLocation",
208 with = "::buffa::json_helpers::proto_string",
209 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
210 )]
211 pub storage_location: ::buffa::alloc::string::String,
212 #[serde(
216 rename = "agent_skill_id",
217 alias = "agentSkillId",
218 with = "::buffa::json_helpers::proto_string",
219 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
220 )]
221 pub agent_skill_id: ::buffa::alloc::string::String,
222 #[serde(
226 rename = "agent_skill_type",
227 alias = "agentSkillType",
228 with = "::buffa::json_helpers::proto_enum",
229 skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
230 )]
231 pub agent_skill_type: ::buffa::EnumValue<AgentSkillType>,
232 #[serde(
238 rename = "description",
239 skip_serializing_if = "::core::option::Option::is_none"
240 )]
241 pub description: ::core::option::Option<::buffa::alloc::string::String>,
242 #[serde(rename = "license", skip_serializing_if = "::core::option::Option::is_none")]
246 pub license: ::core::option::Option<::buffa::alloc::string::String>,
247 #[serde(
251 rename = "allowed_tools",
252 alias = "allowedTools",
253 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
254 deserialize_with = "::buffa::json_helpers::null_as_default"
255 )]
256 pub allowed_tools: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
257 #[serde(
261 rename = "metadata",
262 skip_serializing_if = "::buffa::__private::HashMap::is_empty",
263 deserialize_with = "::buffa::json_helpers::null_as_default"
264 )]
265 pub metadata: ::buffa::__private::HashMap<
266 ::buffa::alloc::string::String,
267 ::buffa::alloc::string::String,
268 >,
269 #[serde(rename = "owner", skip_serializing_if = "::core::option::Option::is_none")]
273 pub owner: ::core::option::Option<::buffa::alloc::string::String>,
274 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
278 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
279 #[serde(
283 rename = "created_at",
284 alias = "createdAt",
285 with = "::buffa::json_helpers::opt_int64",
286 skip_serializing_if = "::core::option::Option::is_none"
287 )]
288 pub created_at: ::core::option::Option<i64>,
289 #[serde(
293 rename = "created_by",
294 alias = "createdBy",
295 skip_serializing_if = "::core::option::Option::is_none"
296 )]
297 pub created_by: ::core::option::Option<::buffa::alloc::string::String>,
298 #[serde(
302 rename = "updated_at",
303 alias = "updatedAt",
304 with = "::buffa::json_helpers::opt_int64",
305 skip_serializing_if = "::core::option::Option::is_none"
306 )]
307 pub updated_at: ::core::option::Option<i64>,
308 #[serde(
312 rename = "updated_by",
313 alias = "updatedBy",
314 skip_serializing_if = "::core::option::Option::is_none"
315 )]
316 pub updated_by: ::core::option::Option<::buffa::alloc::string::String>,
317 #[serde(
321 rename = "metastore_id",
322 alias = "metastoreId",
323 skip_serializing_if = "::core::option::Option::is_none"
324 )]
325 pub metastore_id: ::core::option::Option<::buffa::alloc::string::String>,
326 #[serde(skip)]
327 #[doc(hidden)]
328 pub __buffa_unknown_fields: ::buffa::UnknownFields,
329}
330impl ::core::fmt::Debug for AgentSkill {
331 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
332 f.debug_struct("AgentSkill")
333 .field("name", &self.name)
334 .field("catalog_name", &self.catalog_name)
335 .field("schema_name", &self.schema_name)
336 .field("full_name", &self.full_name)
337 .field("storage_location", &self.storage_location)
338 .field("agent_skill_id", &self.agent_skill_id)
339 .field("agent_skill_type", &self.agent_skill_type)
340 .field("description", &self.description)
341 .field("license", &self.license)
342 .field("allowed_tools", &self.allowed_tools)
343 .field("metadata", &self.metadata)
344 .field("owner", &self.owner)
345 .field("comment", &self.comment)
346 .field("created_at", &self.created_at)
347 .field("created_by", &self.created_by)
348 .field("updated_at", &self.updated_at)
349 .field("updated_by", &self.updated_by)
350 .field("metastore_id", &self.metastore_id)
351 .finish()
352 }
353}
354impl AgentSkill {
355 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.AgentSkill";
360}
361impl AgentSkill {
362 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
363 #[inline]
364 pub fn with_description(
366 mut self,
367 value: impl Into<::buffa::alloc::string::String>,
368 ) -> Self {
369 self.description = Some(value.into());
370 self
371 }
372 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
373 #[inline]
374 pub fn with_license(
376 mut self,
377 value: impl Into<::buffa::alloc::string::String>,
378 ) -> Self {
379 self.license = Some(value.into());
380 self
381 }
382 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
383 #[inline]
384 pub fn with_owner(
386 mut self,
387 value: impl Into<::buffa::alloc::string::String>,
388 ) -> Self {
389 self.owner = Some(value.into());
390 self
391 }
392 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
393 #[inline]
394 pub fn with_comment(
396 mut self,
397 value: impl Into<::buffa::alloc::string::String>,
398 ) -> Self {
399 self.comment = Some(value.into());
400 self
401 }
402 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
403 #[inline]
404 pub fn with_created_at(mut self, value: i64) -> Self {
406 self.created_at = Some(value);
407 self
408 }
409 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
410 #[inline]
411 pub fn with_created_by(
413 mut self,
414 value: impl Into<::buffa::alloc::string::String>,
415 ) -> Self {
416 self.created_by = Some(value.into());
417 self
418 }
419 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
420 #[inline]
421 pub fn with_updated_at(mut self, value: i64) -> Self {
423 self.updated_at = Some(value);
424 self
425 }
426 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
427 #[inline]
428 pub fn with_updated_by(
430 mut self,
431 value: impl Into<::buffa::alloc::string::String>,
432 ) -> Self {
433 self.updated_by = Some(value.into());
434 self
435 }
436 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
437 #[inline]
438 pub fn with_metastore_id(
440 mut self,
441 value: impl Into<::buffa::alloc::string::String>,
442 ) -> Self {
443 self.metastore_id = Some(value.into());
444 self
445 }
446}
447impl ::buffa::DefaultInstance for AgentSkill {
448 fn default_instance() -> &'static Self {
449 static VALUE: ::buffa::__private::OnceBox<AgentSkill> = ::buffa::__private::OnceBox::new();
450 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
451 }
452}
453impl ::buffa::MessageName for AgentSkill {
454 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
455 const NAME: &'static str = "AgentSkill";
456 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.AgentSkill";
457 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.AgentSkill";
458}
459impl ::buffa::Message for AgentSkill {
460 #[allow(clippy::let_and_return)]
466 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
467 #[allow(unused_imports)]
468 use ::buffa::Enumeration as _;
469 let mut size = 0u32;
470 if !self.name.is_empty() {
471 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
472 }
473 if !self.catalog_name.is_empty() {
474 size += 1u32 + ::buffa::types::string_encoded_len(&self.catalog_name) as u32;
475 }
476 if !self.schema_name.is_empty() {
477 size += 1u32 + ::buffa::types::string_encoded_len(&self.schema_name) as u32;
478 }
479 if !self.full_name.is_empty() {
480 size += 1u32 + ::buffa::types::string_encoded_len(&self.full_name) as u32;
481 }
482 if !self.storage_location.is_empty() {
483 size
484 += 1u32
485 + ::buffa::types::string_encoded_len(&self.storage_location) as u32;
486 }
487 if !self.agent_skill_id.is_empty() {
488 size
489 += 1u32
490 + ::buffa::types::string_encoded_len(&self.agent_skill_id) as u32;
491 }
492 {
493 let val = self.agent_skill_type.to_i32();
494 if val != 0 {
495 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
496 }
497 }
498 if let Some(ref v) = self.description {
499 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
500 }
501 if let Some(ref v) = self.license {
502 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
503 }
504 for v in &self.allowed_tools {
505 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
506 }
507 #[allow(clippy::for_kv_map)]
508 for (k, v) in &self.metadata {
509 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
510 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
511 size
512 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
513 + entry_size;
514 }
515 if let Some(ref v) = self.owner {
516 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
517 }
518 if let Some(ref v) = self.comment {
519 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
520 }
521 if let Some(v) = self.created_at {
522 size += 2u32 + ::buffa::types::int64_encoded_len(v) as u32;
523 }
524 if let Some(ref v) = self.created_by {
525 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
526 }
527 if let Some(v) = self.updated_at {
528 size += 2u32 + ::buffa::types::int64_encoded_len(v) as u32;
529 }
530 if let Some(ref v) = self.updated_by {
531 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
532 }
533 if let Some(ref v) = self.metastore_id {
534 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
535 }
536 size += self.__buffa_unknown_fields.encoded_len() as u32;
537 size
538 }
539 fn write_to(
540 &self,
541 _cache: &mut ::buffa::SizeCache,
542 buf: &mut impl ::buffa::bytes::BufMut,
543 ) {
544 #[allow(unused_imports)]
545 use ::buffa::Enumeration as _;
546 if !self.name.is_empty() {
547 ::buffa::encoding::Tag::new(
548 1u32,
549 ::buffa::encoding::WireType::LengthDelimited,
550 )
551 .encode(buf);
552 ::buffa::types::encode_string(&self.name, buf);
553 }
554 if !self.catalog_name.is_empty() {
555 ::buffa::encoding::Tag::new(
556 2u32,
557 ::buffa::encoding::WireType::LengthDelimited,
558 )
559 .encode(buf);
560 ::buffa::types::encode_string(&self.catalog_name, buf);
561 }
562 if !self.schema_name.is_empty() {
563 ::buffa::encoding::Tag::new(
564 3u32,
565 ::buffa::encoding::WireType::LengthDelimited,
566 )
567 .encode(buf);
568 ::buffa::types::encode_string(&self.schema_name, buf);
569 }
570 if !self.full_name.is_empty() {
571 ::buffa::encoding::Tag::new(
572 4u32,
573 ::buffa::encoding::WireType::LengthDelimited,
574 )
575 .encode(buf);
576 ::buffa::types::encode_string(&self.full_name, buf);
577 }
578 if !self.storage_location.is_empty() {
579 ::buffa::encoding::Tag::new(
580 5u32,
581 ::buffa::encoding::WireType::LengthDelimited,
582 )
583 .encode(buf);
584 ::buffa::types::encode_string(&self.storage_location, buf);
585 }
586 if !self.agent_skill_id.is_empty() {
587 ::buffa::encoding::Tag::new(
588 6u32,
589 ::buffa::encoding::WireType::LengthDelimited,
590 )
591 .encode(buf);
592 ::buffa::types::encode_string(&self.agent_skill_id, buf);
593 }
594 {
595 let val = self.agent_skill_type.to_i32();
596 if val != 0 {
597 ::buffa::encoding::Tag::new(7u32, ::buffa::encoding::WireType::Varint)
598 .encode(buf);
599 ::buffa::types::encode_int32(val, buf);
600 }
601 }
602 if let Some(ref v) = self.description {
603 ::buffa::encoding::Tag::new(
604 8u32,
605 ::buffa::encoding::WireType::LengthDelimited,
606 )
607 .encode(buf);
608 ::buffa::types::encode_string(v, buf);
609 }
610 if let Some(ref v) = self.license {
611 ::buffa::encoding::Tag::new(
612 9u32,
613 ::buffa::encoding::WireType::LengthDelimited,
614 )
615 .encode(buf);
616 ::buffa::types::encode_string(v, buf);
617 }
618 for v in &self.allowed_tools {
619 ::buffa::encoding::Tag::new(
620 10u32,
621 ::buffa::encoding::WireType::LengthDelimited,
622 )
623 .encode(buf);
624 ::buffa::types::encode_string(v, buf);
625 }
626 for (k, v) in &self.metadata {
627 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
628 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
629 ::buffa::encoding::Tag::new(
630 11u32,
631 ::buffa::encoding::WireType::LengthDelimited,
632 )
633 .encode(buf);
634 ::buffa::encoding::encode_varint(entry_size as u64, buf);
635 ::buffa::encoding::Tag::new(
636 1u32,
637 ::buffa::encoding::WireType::LengthDelimited,
638 )
639 .encode(buf);
640 ::buffa::types::encode_string(k, buf);
641 ::buffa::encoding::Tag::new(
642 2u32,
643 ::buffa::encoding::WireType::LengthDelimited,
644 )
645 .encode(buf);
646 ::buffa::types::encode_string(v, buf);
647 }
648 if let Some(ref v) = self.owner {
649 ::buffa::encoding::Tag::new(
650 12u32,
651 ::buffa::encoding::WireType::LengthDelimited,
652 )
653 .encode(buf);
654 ::buffa::types::encode_string(v, buf);
655 }
656 if let Some(ref v) = self.comment {
657 ::buffa::encoding::Tag::new(
658 13u32,
659 ::buffa::encoding::WireType::LengthDelimited,
660 )
661 .encode(buf);
662 ::buffa::types::encode_string(v, buf);
663 }
664 if let Some(v) = self.created_at {
665 ::buffa::encoding::Tag::new(1000u32, ::buffa::encoding::WireType::Varint)
666 .encode(buf);
667 ::buffa::types::encode_int64(v, buf);
668 }
669 if let Some(ref v) = self.created_by {
670 ::buffa::encoding::Tag::new(
671 1001u32,
672 ::buffa::encoding::WireType::LengthDelimited,
673 )
674 .encode(buf);
675 ::buffa::types::encode_string(v, buf);
676 }
677 if let Some(v) = self.updated_at {
678 ::buffa::encoding::Tag::new(1002u32, ::buffa::encoding::WireType::Varint)
679 .encode(buf);
680 ::buffa::types::encode_int64(v, buf);
681 }
682 if let Some(ref v) = self.updated_by {
683 ::buffa::encoding::Tag::new(
684 1003u32,
685 ::buffa::encoding::WireType::LengthDelimited,
686 )
687 .encode(buf);
688 ::buffa::types::encode_string(v, buf);
689 }
690 if let Some(ref v) = self.metastore_id {
691 ::buffa::encoding::Tag::new(
692 1004u32,
693 ::buffa::encoding::WireType::LengthDelimited,
694 )
695 .encode(buf);
696 ::buffa::types::encode_string(v, buf);
697 }
698 self.__buffa_unknown_fields.write_to(buf);
699 }
700 fn merge_field(
701 &mut self,
702 tag: ::buffa::encoding::Tag,
703 buf: &mut impl ::buffa::bytes::Buf,
704 depth: u32,
705 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
706 #[allow(unused_imports)]
707 use ::buffa::bytes::Buf as _;
708 #[allow(unused_imports)]
709 use ::buffa::Enumeration as _;
710 match tag.field_number() {
711 1u32 => {
712 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
713 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
714 field_number: 1u32,
715 expected: 2u8,
716 actual: tag.wire_type() as u8,
717 });
718 }
719 ::buffa::types::merge_string(&mut self.name, buf)?;
720 }
721 2u32 => {
722 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
723 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
724 field_number: 2u32,
725 expected: 2u8,
726 actual: tag.wire_type() as u8,
727 });
728 }
729 ::buffa::types::merge_string(&mut self.catalog_name, buf)?;
730 }
731 3u32 => {
732 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
733 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
734 field_number: 3u32,
735 expected: 2u8,
736 actual: tag.wire_type() as u8,
737 });
738 }
739 ::buffa::types::merge_string(&mut self.schema_name, buf)?;
740 }
741 4u32 => {
742 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
743 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
744 field_number: 4u32,
745 expected: 2u8,
746 actual: tag.wire_type() as u8,
747 });
748 }
749 ::buffa::types::merge_string(&mut self.full_name, buf)?;
750 }
751 5u32 => {
752 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
753 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
754 field_number: 5u32,
755 expected: 2u8,
756 actual: tag.wire_type() as u8,
757 });
758 }
759 ::buffa::types::merge_string(&mut self.storage_location, buf)?;
760 }
761 6u32 => {
762 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
763 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
764 field_number: 6u32,
765 expected: 2u8,
766 actual: tag.wire_type() as u8,
767 });
768 }
769 ::buffa::types::merge_string(&mut self.agent_skill_id, buf)?;
770 }
771 7u32 => {
772 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
773 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
774 field_number: 7u32,
775 expected: 0u8,
776 actual: tag.wire_type() as u8,
777 });
778 }
779 self.agent_skill_type = ::buffa::EnumValue::from(
780 ::buffa::types::decode_int32(buf)?,
781 );
782 }
783 8u32 => {
784 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
785 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
786 field_number: 8u32,
787 expected: 2u8,
788 actual: tag.wire_type() as u8,
789 });
790 }
791 ::buffa::types::merge_string(
792 self
793 .description
794 .get_or_insert_with(::buffa::alloc::string::String::new),
795 buf,
796 )?;
797 }
798 9u32 => {
799 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
800 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
801 field_number: 9u32,
802 expected: 2u8,
803 actual: tag.wire_type() as u8,
804 });
805 }
806 ::buffa::types::merge_string(
807 self.license.get_or_insert_with(::buffa::alloc::string::String::new),
808 buf,
809 )?;
810 }
811 10u32 => {
812 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
813 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
814 field_number: 10u32,
815 expected: 2u8,
816 actual: tag.wire_type() as u8,
817 });
818 }
819 self.allowed_tools.push(::buffa::types::decode_string(buf)?);
820 }
821 11u32 => {
822 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
823 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
824 field_number: 11u32,
825 expected: 2u8,
826 actual: tag.wire_type() as u8,
827 });
828 }
829 let entry_len = ::buffa::encoding::decode_varint(buf)?;
830 let entry_len = usize::try_from(entry_len)
831 .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
832 if buf.remaining() < entry_len {
833 return ::core::result::Result::Err(
834 ::buffa::DecodeError::UnexpectedEof,
835 );
836 }
837 let entry_limit = buf.remaining() - entry_len;
838 let mut key = ::core::default::Default::default();
839 let mut val = ::core::default::Default::default();
840 while buf.remaining() > entry_limit {
841 let entry_tag = ::buffa::encoding::Tag::decode(buf)?;
842 match entry_tag.field_number() {
843 1 => {
844 if entry_tag.wire_type()
845 != ::buffa::encoding::WireType::LengthDelimited
846 {
847 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
848 field_number: entry_tag.field_number(),
849 expected: 2u8,
850 actual: entry_tag.wire_type() as u8,
851 });
852 }
853 key = ::buffa::types::decode_string(buf)?;
854 }
855 2 => {
856 if entry_tag.wire_type()
857 != ::buffa::encoding::WireType::LengthDelimited
858 {
859 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
860 field_number: entry_tag.field_number(),
861 expected: 2u8,
862 actual: entry_tag.wire_type() as u8,
863 });
864 }
865 val = ::buffa::types::decode_string(buf)?;
866 }
867 _ => {
868 ::buffa::encoding::skip_field_depth(entry_tag, buf, depth)?;
869 }
870 }
871 }
872 if buf.remaining() != entry_limit {
873 let remaining = buf.remaining();
874 if remaining > entry_limit {
875 buf.advance(remaining - entry_limit);
876 } else {
877 return ::core::result::Result::Err(
878 ::buffa::DecodeError::UnexpectedEof,
879 );
880 }
881 }
882 self.metadata.insert(key, val);
883 }
884 12u32 => {
885 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
886 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
887 field_number: 12u32,
888 expected: 2u8,
889 actual: tag.wire_type() as u8,
890 });
891 }
892 ::buffa::types::merge_string(
893 self.owner.get_or_insert_with(::buffa::alloc::string::String::new),
894 buf,
895 )?;
896 }
897 13u32 => {
898 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
899 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
900 field_number: 13u32,
901 expected: 2u8,
902 actual: tag.wire_type() as u8,
903 });
904 }
905 ::buffa::types::merge_string(
906 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
907 buf,
908 )?;
909 }
910 1000u32 => {
911 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
912 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
913 field_number: 1000u32,
914 expected: 0u8,
915 actual: tag.wire_type() as u8,
916 });
917 }
918 self.created_at = ::core::option::Option::Some(
919 ::buffa::types::decode_int64(buf)?,
920 );
921 }
922 1001u32 => {
923 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
924 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
925 field_number: 1001u32,
926 expected: 2u8,
927 actual: tag.wire_type() as u8,
928 });
929 }
930 ::buffa::types::merge_string(
931 self
932 .created_by
933 .get_or_insert_with(::buffa::alloc::string::String::new),
934 buf,
935 )?;
936 }
937 1002u32 => {
938 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
939 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
940 field_number: 1002u32,
941 expected: 0u8,
942 actual: tag.wire_type() as u8,
943 });
944 }
945 self.updated_at = ::core::option::Option::Some(
946 ::buffa::types::decode_int64(buf)?,
947 );
948 }
949 1003u32 => {
950 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
951 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
952 field_number: 1003u32,
953 expected: 2u8,
954 actual: tag.wire_type() as u8,
955 });
956 }
957 ::buffa::types::merge_string(
958 self
959 .updated_by
960 .get_or_insert_with(::buffa::alloc::string::String::new),
961 buf,
962 )?;
963 }
964 1004u32 => {
965 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
966 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
967 field_number: 1004u32,
968 expected: 2u8,
969 actual: tag.wire_type() as u8,
970 });
971 }
972 ::buffa::types::merge_string(
973 self
974 .metastore_id
975 .get_or_insert_with(::buffa::alloc::string::String::new),
976 buf,
977 )?;
978 }
979 _ => {
980 self.__buffa_unknown_fields
981 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
982 }
983 }
984 ::core::result::Result::Ok(())
985 }
986 fn clear(&mut self) {
987 self.name.clear();
988 self.catalog_name.clear();
989 self.schema_name.clear();
990 self.full_name.clear();
991 self.storage_location.clear();
992 self.agent_skill_id.clear();
993 self.agent_skill_type = ::buffa::EnumValue::from(0);
994 self.description = ::core::option::Option::None;
995 self.license = ::core::option::Option::None;
996 self.allowed_tools.clear();
997 self.metadata.clear();
998 self.owner = ::core::option::Option::None;
999 self.comment = ::core::option::Option::None;
1000 self.created_at = ::core::option::Option::None;
1001 self.created_by = ::core::option::Option::None;
1002 self.updated_at = ::core::option::Option::None;
1003 self.updated_by = ::core::option::Option::None;
1004 self.metastore_id = ::core::option::Option::None;
1005 self.__buffa_unknown_fields.clear();
1006 }
1007}
1008impl ::buffa::ExtensionSet for AgentSkill {
1009 const PROTO_FQN: &'static str = "unitycatalog.agent_skills.v0alpha1.AgentSkill";
1010 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1011 &self.__buffa_unknown_fields
1012 }
1013 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1014 &mut self.__buffa_unknown_fields
1015 }
1016}
1017impl ::buffa::json_helpers::ProtoElemJson for AgentSkill {
1018 fn serialize_proto_json<S: ::serde::Serializer>(
1019 v: &Self,
1020 s: S,
1021 ) -> ::core::result::Result<S::Ok, S::Error> {
1022 ::serde::Serialize::serialize(v, s)
1023 }
1024 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1025 d: D,
1026 ) -> ::core::result::Result<Self, D::Error> {
1027 <Self as ::serde::Deserialize>::deserialize(d)
1028 }
1029}
1030#[doc(hidden)]
1031pub const __AGENT_SKILL_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1032 type_url: "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.AgentSkill",
1033 to_json: ::buffa::type_registry::any_to_json::<AgentSkill>,
1034 from_json: ::buffa::type_registry::any_from_json::<AgentSkill>,
1035 is_wkt: false,
1036};
1037#[derive(Clone, PartialEq, Default)]
1039#[derive(::serde::Serialize, ::serde::Deserialize)]
1040#[serde(default)]
1041pub struct ListAgentSkillsRequest {
1042 #[serde(
1046 rename = "catalog_name",
1047 alias = "catalogName",
1048 with = "::buffa::json_helpers::proto_string",
1049 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1050 )]
1051 pub catalog_name: ::buffa::alloc::string::String,
1052 #[serde(
1056 rename = "schema_name",
1057 alias = "schemaName",
1058 with = "::buffa::json_helpers::proto_string",
1059 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1060 )]
1061 pub schema_name: ::buffa::alloc::string::String,
1062 #[serde(
1066 rename = "max_results",
1067 alias = "maxResults",
1068 with = "::buffa::json_helpers::opt_int32",
1069 skip_serializing_if = "::core::option::Option::is_none"
1070 )]
1071 pub max_results: ::core::option::Option<i32>,
1072 #[serde(
1076 rename = "page_token",
1077 alias = "pageToken",
1078 skip_serializing_if = "::core::option::Option::is_none"
1079 )]
1080 pub page_token: ::core::option::Option<::buffa::alloc::string::String>,
1081 #[serde(
1086 rename = "include_browse",
1087 alias = "includeBrowse",
1088 skip_serializing_if = "::core::option::Option::is_none"
1089 )]
1090 pub include_browse: ::core::option::Option<bool>,
1091 #[serde(skip)]
1092 #[doc(hidden)]
1093 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1094}
1095impl ::core::fmt::Debug for ListAgentSkillsRequest {
1096 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1097 f.debug_struct("ListAgentSkillsRequest")
1098 .field("catalog_name", &self.catalog_name)
1099 .field("schema_name", &self.schema_name)
1100 .field("max_results", &self.max_results)
1101 .field("page_token", &self.page_token)
1102 .field("include_browse", &self.include_browse)
1103 .finish()
1104 }
1105}
1106impl ListAgentSkillsRequest {
1107 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.ListAgentSkillsRequest";
1112}
1113impl ListAgentSkillsRequest {
1114 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1115 #[inline]
1116 pub fn with_max_results(mut self, value: i32) -> Self {
1118 self.max_results = Some(value);
1119 self
1120 }
1121 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1122 #[inline]
1123 pub fn with_page_token(
1125 mut self,
1126 value: impl Into<::buffa::alloc::string::String>,
1127 ) -> Self {
1128 self.page_token = Some(value.into());
1129 self
1130 }
1131 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1132 #[inline]
1133 pub fn with_include_browse(mut self, value: bool) -> Self {
1135 self.include_browse = Some(value);
1136 self
1137 }
1138}
1139impl ::buffa::DefaultInstance for ListAgentSkillsRequest {
1140 fn default_instance() -> &'static Self {
1141 static VALUE: ::buffa::__private::OnceBox<ListAgentSkillsRequest> = ::buffa::__private::OnceBox::new();
1142 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1143 }
1144}
1145impl ::buffa::MessageName for ListAgentSkillsRequest {
1146 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
1147 const NAME: &'static str = "ListAgentSkillsRequest";
1148 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.ListAgentSkillsRequest";
1149 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.ListAgentSkillsRequest";
1150}
1151impl ::buffa::Message for ListAgentSkillsRequest {
1152 #[allow(clippy::let_and_return)]
1158 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1159 #[allow(unused_imports)]
1160 use ::buffa::Enumeration as _;
1161 let mut size = 0u32;
1162 if !self.catalog_name.is_empty() {
1163 size += 1u32 + ::buffa::types::string_encoded_len(&self.catalog_name) as u32;
1164 }
1165 if !self.schema_name.is_empty() {
1166 size += 1u32 + ::buffa::types::string_encoded_len(&self.schema_name) as u32;
1167 }
1168 if let Some(v) = self.max_results {
1169 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
1170 }
1171 if let Some(ref v) = self.page_token {
1172 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1173 }
1174 if self.include_browse.is_some() {
1175 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1176 }
1177 size += self.__buffa_unknown_fields.encoded_len() as u32;
1178 size
1179 }
1180 fn write_to(
1181 &self,
1182 _cache: &mut ::buffa::SizeCache,
1183 buf: &mut impl ::buffa::bytes::BufMut,
1184 ) {
1185 #[allow(unused_imports)]
1186 use ::buffa::Enumeration as _;
1187 if !self.catalog_name.is_empty() {
1188 ::buffa::encoding::Tag::new(
1189 1u32,
1190 ::buffa::encoding::WireType::LengthDelimited,
1191 )
1192 .encode(buf);
1193 ::buffa::types::encode_string(&self.catalog_name, buf);
1194 }
1195 if !self.schema_name.is_empty() {
1196 ::buffa::encoding::Tag::new(
1197 2u32,
1198 ::buffa::encoding::WireType::LengthDelimited,
1199 )
1200 .encode(buf);
1201 ::buffa::types::encode_string(&self.schema_name, buf);
1202 }
1203 if let Some(v) = self.max_results {
1204 ::buffa::encoding::Tag::new(3u32, ::buffa::encoding::WireType::Varint)
1205 .encode(buf);
1206 ::buffa::types::encode_int32(v, buf);
1207 }
1208 if let Some(ref v) = self.page_token {
1209 ::buffa::encoding::Tag::new(
1210 4u32,
1211 ::buffa::encoding::WireType::LengthDelimited,
1212 )
1213 .encode(buf);
1214 ::buffa::types::encode_string(v, buf);
1215 }
1216 if let Some(v) = self.include_browse {
1217 ::buffa::encoding::Tag::new(5u32, ::buffa::encoding::WireType::Varint)
1218 .encode(buf);
1219 ::buffa::types::encode_bool(v, buf);
1220 }
1221 self.__buffa_unknown_fields.write_to(buf);
1222 }
1223 fn merge_field(
1224 &mut self,
1225 tag: ::buffa::encoding::Tag,
1226 buf: &mut impl ::buffa::bytes::Buf,
1227 depth: u32,
1228 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1229 #[allow(unused_imports)]
1230 use ::buffa::bytes::Buf as _;
1231 #[allow(unused_imports)]
1232 use ::buffa::Enumeration as _;
1233 match tag.field_number() {
1234 1u32 => {
1235 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1236 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1237 field_number: 1u32,
1238 expected: 2u8,
1239 actual: tag.wire_type() as u8,
1240 });
1241 }
1242 ::buffa::types::merge_string(&mut self.catalog_name, buf)?;
1243 }
1244 2u32 => {
1245 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1246 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1247 field_number: 2u32,
1248 expected: 2u8,
1249 actual: tag.wire_type() as u8,
1250 });
1251 }
1252 ::buffa::types::merge_string(&mut self.schema_name, buf)?;
1253 }
1254 3u32 => {
1255 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1256 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1257 field_number: 3u32,
1258 expected: 0u8,
1259 actual: tag.wire_type() as u8,
1260 });
1261 }
1262 self.max_results = ::core::option::Option::Some(
1263 ::buffa::types::decode_int32(buf)?,
1264 );
1265 }
1266 4u32 => {
1267 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1268 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1269 field_number: 4u32,
1270 expected: 2u8,
1271 actual: tag.wire_type() as u8,
1272 });
1273 }
1274 ::buffa::types::merge_string(
1275 self
1276 .page_token
1277 .get_or_insert_with(::buffa::alloc::string::String::new),
1278 buf,
1279 )?;
1280 }
1281 5u32 => {
1282 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1283 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1284 field_number: 5u32,
1285 expected: 0u8,
1286 actual: tag.wire_type() as u8,
1287 });
1288 }
1289 self.include_browse = ::core::option::Option::Some(
1290 ::buffa::types::decode_bool(buf)?,
1291 );
1292 }
1293 _ => {
1294 self.__buffa_unknown_fields
1295 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1296 }
1297 }
1298 ::core::result::Result::Ok(())
1299 }
1300 fn clear(&mut self) {
1301 self.catalog_name.clear();
1302 self.schema_name.clear();
1303 self.max_results = ::core::option::Option::None;
1304 self.page_token = ::core::option::Option::None;
1305 self.include_browse = ::core::option::Option::None;
1306 self.__buffa_unknown_fields.clear();
1307 }
1308}
1309impl ::buffa::ExtensionSet for ListAgentSkillsRequest {
1310 const PROTO_FQN: &'static str = "unitycatalog.agent_skills.v0alpha1.ListAgentSkillsRequest";
1311 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1312 &self.__buffa_unknown_fields
1313 }
1314 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1315 &mut self.__buffa_unknown_fields
1316 }
1317}
1318impl ::buffa::json_helpers::ProtoElemJson for ListAgentSkillsRequest {
1319 fn serialize_proto_json<S: ::serde::Serializer>(
1320 v: &Self,
1321 s: S,
1322 ) -> ::core::result::Result<S::Ok, S::Error> {
1323 ::serde::Serialize::serialize(v, s)
1324 }
1325 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1326 d: D,
1327 ) -> ::core::result::Result<Self, D::Error> {
1328 <Self as ::serde::Deserialize>::deserialize(d)
1329 }
1330}
1331#[doc(hidden)]
1332pub const __LIST_AGENT_SKILLS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1333 type_url: "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.ListAgentSkillsRequest",
1334 to_json: ::buffa::type_registry::any_to_json::<ListAgentSkillsRequest>,
1335 from_json: ::buffa::type_registry::any_from_json::<ListAgentSkillsRequest>,
1336 is_wkt: false,
1337};
1338#[derive(Clone, PartialEq, Default)]
1340#[derive(::serde::Serialize, ::serde::Deserialize)]
1341#[serde(default)]
1342pub struct ListAgentSkillsResponse {
1343 #[serde(
1347 rename = "agent_skills",
1348 alias = "agentSkills",
1349 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1350 deserialize_with = "::buffa::json_helpers::null_as_default"
1351 )]
1352 pub agent_skills: ::buffa::alloc::vec::Vec<AgentSkill>,
1353 #[serde(
1360 rename = "next_page_token",
1361 alias = "nextPageToken",
1362 skip_serializing_if = "::core::option::Option::is_none"
1363 )]
1364 pub next_page_token: ::core::option::Option<::buffa::alloc::string::String>,
1365 #[serde(skip)]
1366 #[doc(hidden)]
1367 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1368}
1369impl ::core::fmt::Debug for ListAgentSkillsResponse {
1370 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1371 f.debug_struct("ListAgentSkillsResponse")
1372 .field("agent_skills", &self.agent_skills)
1373 .field("next_page_token", &self.next_page_token)
1374 .finish()
1375 }
1376}
1377impl ListAgentSkillsResponse {
1378 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.ListAgentSkillsResponse";
1383}
1384impl ListAgentSkillsResponse {
1385 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1386 #[inline]
1387 pub fn with_next_page_token(
1389 mut self,
1390 value: impl Into<::buffa::alloc::string::String>,
1391 ) -> Self {
1392 self.next_page_token = Some(value.into());
1393 self
1394 }
1395}
1396impl ::buffa::DefaultInstance for ListAgentSkillsResponse {
1397 fn default_instance() -> &'static Self {
1398 static VALUE: ::buffa::__private::OnceBox<ListAgentSkillsResponse> = ::buffa::__private::OnceBox::new();
1399 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1400 }
1401}
1402impl ::buffa::MessageName for ListAgentSkillsResponse {
1403 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
1404 const NAME: &'static str = "ListAgentSkillsResponse";
1405 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.ListAgentSkillsResponse";
1406 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.ListAgentSkillsResponse";
1407}
1408impl ::buffa::Message for ListAgentSkillsResponse {
1409 #[allow(clippy::let_and_return)]
1415 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
1416 #[allow(unused_imports)]
1417 use ::buffa::Enumeration as _;
1418 let mut size = 0u32;
1419 for v in &self.agent_skills {
1420 let __slot = __cache.reserve();
1421 let inner_size = v.compute_size(__cache);
1422 __cache.set(__slot, inner_size);
1423 size
1424 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
1425 + inner_size;
1426 }
1427 if let Some(ref v) = self.next_page_token {
1428 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1429 }
1430 size += self.__buffa_unknown_fields.encoded_len() as u32;
1431 size
1432 }
1433 fn write_to(
1434 &self,
1435 __cache: &mut ::buffa::SizeCache,
1436 buf: &mut impl ::buffa::bytes::BufMut,
1437 ) {
1438 #[allow(unused_imports)]
1439 use ::buffa::Enumeration as _;
1440 for v in &self.agent_skills {
1441 ::buffa::encoding::Tag::new(
1442 1u32,
1443 ::buffa::encoding::WireType::LengthDelimited,
1444 )
1445 .encode(buf);
1446 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
1447 v.write_to(__cache, buf);
1448 }
1449 if let Some(ref v) = self.next_page_token {
1450 ::buffa::encoding::Tag::new(
1451 2u32,
1452 ::buffa::encoding::WireType::LengthDelimited,
1453 )
1454 .encode(buf);
1455 ::buffa::types::encode_string(v, buf);
1456 }
1457 self.__buffa_unknown_fields.write_to(buf);
1458 }
1459 fn merge_field(
1460 &mut self,
1461 tag: ::buffa::encoding::Tag,
1462 buf: &mut impl ::buffa::bytes::Buf,
1463 depth: u32,
1464 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1465 #[allow(unused_imports)]
1466 use ::buffa::bytes::Buf as _;
1467 #[allow(unused_imports)]
1468 use ::buffa::Enumeration as _;
1469 match tag.field_number() {
1470 1u32 => {
1471 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1472 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1473 field_number: 1u32,
1474 expected: 2u8,
1475 actual: tag.wire_type() as u8,
1476 });
1477 }
1478 let mut elem = ::core::default::Default::default();
1479 ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
1480 self.agent_skills.push(elem);
1481 }
1482 2u32 => {
1483 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1484 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1485 field_number: 2u32,
1486 expected: 2u8,
1487 actual: tag.wire_type() as u8,
1488 });
1489 }
1490 ::buffa::types::merge_string(
1491 self
1492 .next_page_token
1493 .get_or_insert_with(::buffa::alloc::string::String::new),
1494 buf,
1495 )?;
1496 }
1497 _ => {
1498 self.__buffa_unknown_fields
1499 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1500 }
1501 }
1502 ::core::result::Result::Ok(())
1503 }
1504 fn clear(&mut self) {
1505 self.agent_skills.clear();
1506 self.next_page_token = ::core::option::Option::None;
1507 self.__buffa_unknown_fields.clear();
1508 }
1509}
1510impl ::buffa::ExtensionSet for ListAgentSkillsResponse {
1511 const PROTO_FQN: &'static str = "unitycatalog.agent_skills.v0alpha1.ListAgentSkillsResponse";
1512 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1513 &self.__buffa_unknown_fields
1514 }
1515 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1516 &mut self.__buffa_unknown_fields
1517 }
1518}
1519impl ::buffa::json_helpers::ProtoElemJson for ListAgentSkillsResponse {
1520 fn serialize_proto_json<S: ::serde::Serializer>(
1521 v: &Self,
1522 s: S,
1523 ) -> ::core::result::Result<S::Ok, S::Error> {
1524 ::serde::Serialize::serialize(v, s)
1525 }
1526 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1527 d: D,
1528 ) -> ::core::result::Result<Self, D::Error> {
1529 <Self as ::serde::Deserialize>::deserialize(d)
1530 }
1531}
1532#[doc(hidden)]
1533pub const __LIST_AGENT_SKILLS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1534 type_url: "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.ListAgentSkillsResponse",
1535 to_json: ::buffa::type_registry::any_to_json::<ListAgentSkillsResponse>,
1536 from_json: ::buffa::type_registry::any_from_json::<ListAgentSkillsResponse>,
1537 is_wkt: false,
1538};
1539#[derive(Clone, PartialEq, Default)]
1541#[derive(::serde::Serialize, ::serde::Deserialize)]
1542#[serde(default)]
1543pub struct CreateAgentSkillRequest {
1544 #[serde(
1548 rename = "catalog_name",
1549 alias = "catalogName",
1550 with = "::buffa::json_helpers::proto_string",
1551 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1552 )]
1553 pub catalog_name: ::buffa::alloc::string::String,
1554 #[serde(
1558 rename = "schema_name",
1559 alias = "schemaName",
1560 with = "::buffa::json_helpers::proto_string",
1561 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1562 )]
1563 pub schema_name: ::buffa::alloc::string::String,
1564 #[serde(
1568 rename = "name",
1569 with = "::buffa::json_helpers::proto_string",
1570 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1571 )]
1572 pub name: ::buffa::alloc::string::String,
1573 #[serde(
1577 rename = "agent_skill_type",
1578 alias = "agentSkillType",
1579 with = "::buffa::json_helpers::proto_enum",
1580 skip_serializing_if = "::buffa::json_helpers::skip_if::is_default_enum_value"
1581 )]
1582 pub agent_skill_type: ::buffa::EnumValue<AgentSkillType>,
1583 #[serde(
1589 rename = "storage_location",
1590 alias = "storageLocation",
1591 skip_serializing_if = "::core::option::Option::is_none"
1592 )]
1593 pub storage_location: ::core::option::Option<::buffa::alloc::string::String>,
1594 #[serde(
1598 rename = "description",
1599 skip_serializing_if = "::core::option::Option::is_none"
1600 )]
1601 pub description: ::core::option::Option<::buffa::alloc::string::String>,
1602 #[serde(rename = "license", skip_serializing_if = "::core::option::Option::is_none")]
1606 pub license: ::core::option::Option<::buffa::alloc::string::String>,
1607 #[serde(
1611 rename = "allowed_tools",
1612 alias = "allowedTools",
1613 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
1614 deserialize_with = "::buffa::json_helpers::null_as_default"
1615 )]
1616 pub allowed_tools: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
1617 #[serde(
1621 rename = "metadata",
1622 skip_serializing_if = "::buffa::__private::HashMap::is_empty",
1623 deserialize_with = "::buffa::json_helpers::null_as_default"
1624 )]
1625 pub metadata: ::buffa::__private::HashMap<
1626 ::buffa::alloc::string::String,
1627 ::buffa::alloc::string::String,
1628 >,
1629 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
1633 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
1634 #[serde(skip)]
1635 #[doc(hidden)]
1636 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1637}
1638impl ::core::fmt::Debug for CreateAgentSkillRequest {
1639 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1640 f.debug_struct("CreateAgentSkillRequest")
1641 .field("catalog_name", &self.catalog_name)
1642 .field("schema_name", &self.schema_name)
1643 .field("name", &self.name)
1644 .field("agent_skill_type", &self.agent_skill_type)
1645 .field("storage_location", &self.storage_location)
1646 .field("description", &self.description)
1647 .field("license", &self.license)
1648 .field("allowed_tools", &self.allowed_tools)
1649 .field("metadata", &self.metadata)
1650 .field("comment", &self.comment)
1651 .finish()
1652 }
1653}
1654impl CreateAgentSkillRequest {
1655 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.CreateAgentSkillRequest";
1660}
1661impl CreateAgentSkillRequest {
1662 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1663 #[inline]
1664 pub fn with_storage_location(
1666 mut self,
1667 value: impl Into<::buffa::alloc::string::String>,
1668 ) -> Self {
1669 self.storage_location = Some(value.into());
1670 self
1671 }
1672 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1673 #[inline]
1674 pub fn with_description(
1676 mut self,
1677 value: impl Into<::buffa::alloc::string::String>,
1678 ) -> Self {
1679 self.description = Some(value.into());
1680 self
1681 }
1682 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1683 #[inline]
1684 pub fn with_license(
1686 mut self,
1687 value: impl Into<::buffa::alloc::string::String>,
1688 ) -> Self {
1689 self.license = Some(value.into());
1690 self
1691 }
1692 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1693 #[inline]
1694 pub fn with_comment(
1696 mut self,
1697 value: impl Into<::buffa::alloc::string::String>,
1698 ) -> Self {
1699 self.comment = Some(value.into());
1700 self
1701 }
1702}
1703impl ::buffa::DefaultInstance for CreateAgentSkillRequest {
1704 fn default_instance() -> &'static Self {
1705 static VALUE: ::buffa::__private::OnceBox<CreateAgentSkillRequest> = ::buffa::__private::OnceBox::new();
1706 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1707 }
1708}
1709impl ::buffa::MessageName for CreateAgentSkillRequest {
1710 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
1711 const NAME: &'static str = "CreateAgentSkillRequest";
1712 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.CreateAgentSkillRequest";
1713 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.CreateAgentSkillRequest";
1714}
1715impl ::buffa::Message for CreateAgentSkillRequest {
1716 #[allow(clippy::let_and_return)]
1722 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1723 #[allow(unused_imports)]
1724 use ::buffa::Enumeration as _;
1725 let mut size = 0u32;
1726 if !self.catalog_name.is_empty() {
1727 size += 1u32 + ::buffa::types::string_encoded_len(&self.catalog_name) as u32;
1728 }
1729 if !self.schema_name.is_empty() {
1730 size += 1u32 + ::buffa::types::string_encoded_len(&self.schema_name) as u32;
1731 }
1732 if !self.name.is_empty() {
1733 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
1734 }
1735 {
1736 let val = self.agent_skill_type.to_i32();
1737 if val != 0 {
1738 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
1739 }
1740 }
1741 if let Some(ref v) = self.storage_location {
1742 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1743 }
1744 if let Some(ref v) = self.description {
1745 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1746 }
1747 if let Some(ref v) = self.license {
1748 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1749 }
1750 for v in &self.allowed_tools {
1751 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1752 }
1753 #[allow(clippy::for_kv_map)]
1754 for (k, v) in &self.metadata {
1755 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
1756 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1757 size
1758 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
1759 + entry_size;
1760 }
1761 if let Some(ref v) = self.comment {
1762 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1763 }
1764 size += self.__buffa_unknown_fields.encoded_len() as u32;
1765 size
1766 }
1767 fn write_to(
1768 &self,
1769 _cache: &mut ::buffa::SizeCache,
1770 buf: &mut impl ::buffa::bytes::BufMut,
1771 ) {
1772 #[allow(unused_imports)]
1773 use ::buffa::Enumeration as _;
1774 if !self.catalog_name.is_empty() {
1775 ::buffa::encoding::Tag::new(
1776 1u32,
1777 ::buffa::encoding::WireType::LengthDelimited,
1778 )
1779 .encode(buf);
1780 ::buffa::types::encode_string(&self.catalog_name, buf);
1781 }
1782 if !self.schema_name.is_empty() {
1783 ::buffa::encoding::Tag::new(
1784 2u32,
1785 ::buffa::encoding::WireType::LengthDelimited,
1786 )
1787 .encode(buf);
1788 ::buffa::types::encode_string(&self.schema_name, buf);
1789 }
1790 if !self.name.is_empty() {
1791 ::buffa::encoding::Tag::new(
1792 3u32,
1793 ::buffa::encoding::WireType::LengthDelimited,
1794 )
1795 .encode(buf);
1796 ::buffa::types::encode_string(&self.name, buf);
1797 }
1798 {
1799 let val = self.agent_skill_type.to_i32();
1800 if val != 0 {
1801 ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
1802 .encode(buf);
1803 ::buffa::types::encode_int32(val, buf);
1804 }
1805 }
1806 if let Some(ref v) = self.storage_location {
1807 ::buffa::encoding::Tag::new(
1808 5u32,
1809 ::buffa::encoding::WireType::LengthDelimited,
1810 )
1811 .encode(buf);
1812 ::buffa::types::encode_string(v, buf);
1813 }
1814 if let Some(ref v) = self.description {
1815 ::buffa::encoding::Tag::new(
1816 6u32,
1817 ::buffa::encoding::WireType::LengthDelimited,
1818 )
1819 .encode(buf);
1820 ::buffa::types::encode_string(v, buf);
1821 }
1822 if let Some(ref v) = self.license {
1823 ::buffa::encoding::Tag::new(
1824 7u32,
1825 ::buffa::encoding::WireType::LengthDelimited,
1826 )
1827 .encode(buf);
1828 ::buffa::types::encode_string(v, buf);
1829 }
1830 for v in &self.allowed_tools {
1831 ::buffa::encoding::Tag::new(
1832 8u32,
1833 ::buffa::encoding::WireType::LengthDelimited,
1834 )
1835 .encode(buf);
1836 ::buffa::types::encode_string(v, buf);
1837 }
1838 for (k, v) in &self.metadata {
1839 let entry_size: u32 = 1u32 + ::buffa::types::string_encoded_len(k) as u32
1840 + 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1841 ::buffa::encoding::Tag::new(
1842 9u32,
1843 ::buffa::encoding::WireType::LengthDelimited,
1844 )
1845 .encode(buf);
1846 ::buffa::encoding::encode_varint(entry_size as u64, buf);
1847 ::buffa::encoding::Tag::new(
1848 1u32,
1849 ::buffa::encoding::WireType::LengthDelimited,
1850 )
1851 .encode(buf);
1852 ::buffa::types::encode_string(k, buf);
1853 ::buffa::encoding::Tag::new(
1854 2u32,
1855 ::buffa::encoding::WireType::LengthDelimited,
1856 )
1857 .encode(buf);
1858 ::buffa::types::encode_string(v, buf);
1859 }
1860 if let Some(ref v) = self.comment {
1861 ::buffa::encoding::Tag::new(
1862 10u32,
1863 ::buffa::encoding::WireType::LengthDelimited,
1864 )
1865 .encode(buf);
1866 ::buffa::types::encode_string(v, buf);
1867 }
1868 self.__buffa_unknown_fields.write_to(buf);
1869 }
1870 fn merge_field(
1871 &mut self,
1872 tag: ::buffa::encoding::Tag,
1873 buf: &mut impl ::buffa::bytes::Buf,
1874 depth: u32,
1875 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1876 #[allow(unused_imports)]
1877 use ::buffa::bytes::Buf as _;
1878 #[allow(unused_imports)]
1879 use ::buffa::Enumeration as _;
1880 match tag.field_number() {
1881 1u32 => {
1882 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1883 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1884 field_number: 1u32,
1885 expected: 2u8,
1886 actual: tag.wire_type() as u8,
1887 });
1888 }
1889 ::buffa::types::merge_string(&mut self.catalog_name, buf)?;
1890 }
1891 2u32 => {
1892 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1893 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1894 field_number: 2u32,
1895 expected: 2u8,
1896 actual: tag.wire_type() as u8,
1897 });
1898 }
1899 ::buffa::types::merge_string(&mut self.schema_name, buf)?;
1900 }
1901 3u32 => {
1902 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1903 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1904 field_number: 3u32,
1905 expected: 2u8,
1906 actual: tag.wire_type() as u8,
1907 });
1908 }
1909 ::buffa::types::merge_string(&mut self.name, buf)?;
1910 }
1911 4u32 => {
1912 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1913 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1914 field_number: 4u32,
1915 expected: 0u8,
1916 actual: tag.wire_type() as u8,
1917 });
1918 }
1919 self.agent_skill_type = ::buffa::EnumValue::from(
1920 ::buffa::types::decode_int32(buf)?,
1921 );
1922 }
1923 5u32 => {
1924 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1925 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1926 field_number: 5u32,
1927 expected: 2u8,
1928 actual: tag.wire_type() as u8,
1929 });
1930 }
1931 ::buffa::types::merge_string(
1932 self
1933 .storage_location
1934 .get_or_insert_with(::buffa::alloc::string::String::new),
1935 buf,
1936 )?;
1937 }
1938 6u32 => {
1939 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1940 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1941 field_number: 6u32,
1942 expected: 2u8,
1943 actual: tag.wire_type() as u8,
1944 });
1945 }
1946 ::buffa::types::merge_string(
1947 self
1948 .description
1949 .get_or_insert_with(::buffa::alloc::string::String::new),
1950 buf,
1951 )?;
1952 }
1953 7u32 => {
1954 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1955 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1956 field_number: 7u32,
1957 expected: 2u8,
1958 actual: tag.wire_type() as u8,
1959 });
1960 }
1961 ::buffa::types::merge_string(
1962 self.license.get_or_insert_with(::buffa::alloc::string::String::new),
1963 buf,
1964 )?;
1965 }
1966 8u32 => {
1967 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1968 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1969 field_number: 8u32,
1970 expected: 2u8,
1971 actual: tag.wire_type() as u8,
1972 });
1973 }
1974 self.allowed_tools.push(::buffa::types::decode_string(buf)?);
1975 }
1976 9u32 => {
1977 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1978 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1979 field_number: 9u32,
1980 expected: 2u8,
1981 actual: tag.wire_type() as u8,
1982 });
1983 }
1984 let entry_len = ::buffa::encoding::decode_varint(buf)?;
1985 let entry_len = usize::try_from(entry_len)
1986 .map_err(|_| ::buffa::DecodeError::MessageTooLarge)?;
1987 if buf.remaining() < entry_len {
1988 return ::core::result::Result::Err(
1989 ::buffa::DecodeError::UnexpectedEof,
1990 );
1991 }
1992 let entry_limit = buf.remaining() - entry_len;
1993 let mut key = ::core::default::Default::default();
1994 let mut val = ::core::default::Default::default();
1995 while buf.remaining() > entry_limit {
1996 let entry_tag = ::buffa::encoding::Tag::decode(buf)?;
1997 match entry_tag.field_number() {
1998 1 => {
1999 if entry_tag.wire_type()
2000 != ::buffa::encoding::WireType::LengthDelimited
2001 {
2002 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2003 field_number: entry_tag.field_number(),
2004 expected: 2u8,
2005 actual: entry_tag.wire_type() as u8,
2006 });
2007 }
2008 key = ::buffa::types::decode_string(buf)?;
2009 }
2010 2 => {
2011 if entry_tag.wire_type()
2012 != ::buffa::encoding::WireType::LengthDelimited
2013 {
2014 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2015 field_number: entry_tag.field_number(),
2016 expected: 2u8,
2017 actual: entry_tag.wire_type() as u8,
2018 });
2019 }
2020 val = ::buffa::types::decode_string(buf)?;
2021 }
2022 _ => {
2023 ::buffa::encoding::skip_field_depth(entry_tag, buf, depth)?;
2024 }
2025 }
2026 }
2027 if buf.remaining() != entry_limit {
2028 let remaining = buf.remaining();
2029 if remaining > entry_limit {
2030 buf.advance(remaining - entry_limit);
2031 } else {
2032 return ::core::result::Result::Err(
2033 ::buffa::DecodeError::UnexpectedEof,
2034 );
2035 }
2036 }
2037 self.metadata.insert(key, val);
2038 }
2039 10u32 => {
2040 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2041 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2042 field_number: 10u32,
2043 expected: 2u8,
2044 actual: tag.wire_type() as u8,
2045 });
2046 }
2047 ::buffa::types::merge_string(
2048 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
2049 buf,
2050 )?;
2051 }
2052 _ => {
2053 self.__buffa_unknown_fields
2054 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2055 }
2056 }
2057 ::core::result::Result::Ok(())
2058 }
2059 fn clear(&mut self) {
2060 self.catalog_name.clear();
2061 self.schema_name.clear();
2062 self.name.clear();
2063 self.agent_skill_type = ::buffa::EnumValue::from(0);
2064 self.storage_location = ::core::option::Option::None;
2065 self.description = ::core::option::Option::None;
2066 self.license = ::core::option::Option::None;
2067 self.allowed_tools.clear();
2068 self.metadata.clear();
2069 self.comment = ::core::option::Option::None;
2070 self.__buffa_unknown_fields.clear();
2071 }
2072}
2073impl ::buffa::ExtensionSet for CreateAgentSkillRequest {
2074 const PROTO_FQN: &'static str = "unitycatalog.agent_skills.v0alpha1.CreateAgentSkillRequest";
2075 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2076 &self.__buffa_unknown_fields
2077 }
2078 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2079 &mut self.__buffa_unknown_fields
2080 }
2081}
2082impl ::buffa::json_helpers::ProtoElemJson for CreateAgentSkillRequest {
2083 fn serialize_proto_json<S: ::serde::Serializer>(
2084 v: &Self,
2085 s: S,
2086 ) -> ::core::result::Result<S::Ok, S::Error> {
2087 ::serde::Serialize::serialize(v, s)
2088 }
2089 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2090 d: D,
2091 ) -> ::core::result::Result<Self, D::Error> {
2092 <Self as ::serde::Deserialize>::deserialize(d)
2093 }
2094}
2095#[doc(hidden)]
2096pub const __CREATE_AGENT_SKILL_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2097 type_url: "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.CreateAgentSkillRequest",
2098 to_json: ::buffa::type_registry::any_to_json::<CreateAgentSkillRequest>,
2099 from_json: ::buffa::type_registry::any_from_json::<CreateAgentSkillRequest>,
2100 is_wkt: false,
2101};
2102#[derive(Clone, PartialEq, Default)]
2103#[derive(::serde::Serialize, ::serde::Deserialize)]
2104#[serde(default)]
2105pub struct GetAgentSkillRequest {
2106 #[serde(
2110 rename = "name",
2111 with = "::buffa::json_helpers::proto_string",
2112 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2113 )]
2114 pub name: ::buffa::alloc::string::String,
2115 #[serde(
2120 rename = "include_browse",
2121 alias = "includeBrowse",
2122 skip_serializing_if = "::core::option::Option::is_none"
2123 )]
2124 pub include_browse: ::core::option::Option<bool>,
2125 #[serde(skip)]
2126 #[doc(hidden)]
2127 pub __buffa_unknown_fields: ::buffa::UnknownFields,
2128}
2129impl ::core::fmt::Debug for GetAgentSkillRequest {
2130 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2131 f.debug_struct("GetAgentSkillRequest")
2132 .field("name", &self.name)
2133 .field("include_browse", &self.include_browse)
2134 .finish()
2135 }
2136}
2137impl GetAgentSkillRequest {
2138 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.GetAgentSkillRequest";
2143}
2144impl GetAgentSkillRequest {
2145 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2146 #[inline]
2147 pub fn with_include_browse(mut self, value: bool) -> Self {
2149 self.include_browse = Some(value);
2150 self
2151 }
2152}
2153impl ::buffa::DefaultInstance for GetAgentSkillRequest {
2154 fn default_instance() -> &'static Self {
2155 static VALUE: ::buffa::__private::OnceBox<GetAgentSkillRequest> = ::buffa::__private::OnceBox::new();
2156 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2157 }
2158}
2159impl ::buffa::MessageName for GetAgentSkillRequest {
2160 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
2161 const NAME: &'static str = "GetAgentSkillRequest";
2162 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.GetAgentSkillRequest";
2163 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.GetAgentSkillRequest";
2164}
2165impl ::buffa::Message for GetAgentSkillRequest {
2166 #[allow(clippy::let_and_return)]
2172 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2173 #[allow(unused_imports)]
2174 use ::buffa::Enumeration as _;
2175 let mut size = 0u32;
2176 if !self.name.is_empty() {
2177 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
2178 }
2179 if self.include_browse.is_some() {
2180 size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
2181 }
2182 size += self.__buffa_unknown_fields.encoded_len() as u32;
2183 size
2184 }
2185 fn write_to(
2186 &self,
2187 _cache: &mut ::buffa::SizeCache,
2188 buf: &mut impl ::buffa::bytes::BufMut,
2189 ) {
2190 #[allow(unused_imports)]
2191 use ::buffa::Enumeration as _;
2192 if !self.name.is_empty() {
2193 ::buffa::encoding::Tag::new(
2194 1u32,
2195 ::buffa::encoding::WireType::LengthDelimited,
2196 )
2197 .encode(buf);
2198 ::buffa::types::encode_string(&self.name, buf);
2199 }
2200 if let Some(v) = self.include_browse {
2201 ::buffa::encoding::Tag::new(1005u32, ::buffa::encoding::WireType::Varint)
2202 .encode(buf);
2203 ::buffa::types::encode_bool(v, buf);
2204 }
2205 self.__buffa_unknown_fields.write_to(buf);
2206 }
2207 fn merge_field(
2208 &mut self,
2209 tag: ::buffa::encoding::Tag,
2210 buf: &mut impl ::buffa::bytes::Buf,
2211 depth: u32,
2212 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2213 #[allow(unused_imports)]
2214 use ::buffa::bytes::Buf as _;
2215 #[allow(unused_imports)]
2216 use ::buffa::Enumeration as _;
2217 match tag.field_number() {
2218 1u32 => {
2219 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2220 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2221 field_number: 1u32,
2222 expected: 2u8,
2223 actual: tag.wire_type() as u8,
2224 });
2225 }
2226 ::buffa::types::merge_string(&mut self.name, buf)?;
2227 }
2228 1005u32 => {
2229 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2230 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2231 field_number: 1005u32,
2232 expected: 0u8,
2233 actual: tag.wire_type() as u8,
2234 });
2235 }
2236 self.include_browse = ::core::option::Option::Some(
2237 ::buffa::types::decode_bool(buf)?,
2238 );
2239 }
2240 _ => {
2241 self.__buffa_unknown_fields
2242 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2243 }
2244 }
2245 ::core::result::Result::Ok(())
2246 }
2247 fn clear(&mut self) {
2248 self.name.clear();
2249 self.include_browse = ::core::option::Option::None;
2250 self.__buffa_unknown_fields.clear();
2251 }
2252}
2253impl ::buffa::ExtensionSet for GetAgentSkillRequest {
2254 const PROTO_FQN: &'static str = "unitycatalog.agent_skills.v0alpha1.GetAgentSkillRequest";
2255 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2256 &self.__buffa_unknown_fields
2257 }
2258 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2259 &mut self.__buffa_unknown_fields
2260 }
2261}
2262impl ::buffa::json_helpers::ProtoElemJson for GetAgentSkillRequest {
2263 fn serialize_proto_json<S: ::serde::Serializer>(
2264 v: &Self,
2265 s: S,
2266 ) -> ::core::result::Result<S::Ok, S::Error> {
2267 ::serde::Serialize::serialize(v, s)
2268 }
2269 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2270 d: D,
2271 ) -> ::core::result::Result<Self, D::Error> {
2272 <Self as ::serde::Deserialize>::deserialize(d)
2273 }
2274}
2275#[doc(hidden)]
2276pub const __GET_AGENT_SKILL_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2277 type_url: "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.GetAgentSkillRequest",
2278 to_json: ::buffa::type_registry::any_to_json::<GetAgentSkillRequest>,
2279 from_json: ::buffa::type_registry::any_from_json::<GetAgentSkillRequest>,
2280 is_wkt: false,
2281};
2282#[derive(Clone, PartialEq, Default)]
2283#[derive(::serde::Serialize, ::serde::Deserialize)]
2284#[serde(default)]
2285pub struct UpdateAgentSkillRequest {
2286 #[serde(
2290 rename = "name",
2291 with = "::buffa::json_helpers::proto_string",
2292 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2293 )]
2294 pub name: ::buffa::alloc::string::String,
2295 #[serde(
2299 rename = "new_name",
2300 alias = "newName",
2301 skip_serializing_if = "::core::option::Option::is_none"
2302 )]
2303 pub new_name: ::core::option::Option<::buffa::alloc::string::String>,
2304 #[serde(
2308 rename = "description",
2309 skip_serializing_if = "::core::option::Option::is_none"
2310 )]
2311 pub description: ::core::option::Option<::buffa::alloc::string::String>,
2312 #[serde(
2316 rename = "allowed_tools",
2317 alias = "allowedTools",
2318 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
2319 deserialize_with = "::buffa::json_helpers::null_as_default"
2320 )]
2321 pub allowed_tools: ::buffa::alloc::vec::Vec<::buffa::alloc::string::String>,
2322 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
2326 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
2327 #[serde(rename = "owner", skip_serializing_if = "::core::option::Option::is_none")]
2331 pub owner: ::core::option::Option<::buffa::alloc::string::String>,
2332 #[serde(skip)]
2333 #[doc(hidden)]
2334 pub __buffa_unknown_fields: ::buffa::UnknownFields,
2335}
2336impl ::core::fmt::Debug for UpdateAgentSkillRequest {
2337 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2338 f.debug_struct("UpdateAgentSkillRequest")
2339 .field("name", &self.name)
2340 .field("new_name", &self.new_name)
2341 .field("description", &self.description)
2342 .field("allowed_tools", &self.allowed_tools)
2343 .field("comment", &self.comment)
2344 .field("owner", &self.owner)
2345 .finish()
2346 }
2347}
2348impl UpdateAgentSkillRequest {
2349 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.UpdateAgentSkillRequest";
2354}
2355impl UpdateAgentSkillRequest {
2356 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2357 #[inline]
2358 pub fn with_new_name(
2360 mut self,
2361 value: impl Into<::buffa::alloc::string::String>,
2362 ) -> Self {
2363 self.new_name = Some(value.into());
2364 self
2365 }
2366 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2367 #[inline]
2368 pub fn with_description(
2370 mut self,
2371 value: impl Into<::buffa::alloc::string::String>,
2372 ) -> Self {
2373 self.description = Some(value.into());
2374 self
2375 }
2376 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2377 #[inline]
2378 pub fn with_comment(
2380 mut self,
2381 value: impl Into<::buffa::alloc::string::String>,
2382 ) -> Self {
2383 self.comment = Some(value.into());
2384 self
2385 }
2386 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2387 #[inline]
2388 pub fn with_owner(
2390 mut self,
2391 value: impl Into<::buffa::alloc::string::String>,
2392 ) -> Self {
2393 self.owner = Some(value.into());
2394 self
2395 }
2396}
2397impl ::buffa::DefaultInstance for UpdateAgentSkillRequest {
2398 fn default_instance() -> &'static Self {
2399 static VALUE: ::buffa::__private::OnceBox<UpdateAgentSkillRequest> = ::buffa::__private::OnceBox::new();
2400 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2401 }
2402}
2403impl ::buffa::MessageName for UpdateAgentSkillRequest {
2404 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
2405 const NAME: &'static str = "UpdateAgentSkillRequest";
2406 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.UpdateAgentSkillRequest";
2407 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.UpdateAgentSkillRequest";
2408}
2409impl ::buffa::Message for UpdateAgentSkillRequest {
2410 #[allow(clippy::let_and_return)]
2416 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2417 #[allow(unused_imports)]
2418 use ::buffa::Enumeration as _;
2419 let mut size = 0u32;
2420 if !self.name.is_empty() {
2421 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
2422 }
2423 if let Some(ref v) = self.new_name {
2424 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2425 }
2426 if let Some(ref v) = self.description {
2427 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2428 }
2429 for v in &self.allowed_tools {
2430 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2431 }
2432 if let Some(ref v) = self.comment {
2433 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2434 }
2435 if let Some(ref v) = self.owner {
2436 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2437 }
2438 size += self.__buffa_unknown_fields.encoded_len() as u32;
2439 size
2440 }
2441 fn write_to(
2442 &self,
2443 _cache: &mut ::buffa::SizeCache,
2444 buf: &mut impl ::buffa::bytes::BufMut,
2445 ) {
2446 #[allow(unused_imports)]
2447 use ::buffa::Enumeration as _;
2448 if !self.name.is_empty() {
2449 ::buffa::encoding::Tag::new(
2450 1u32,
2451 ::buffa::encoding::WireType::LengthDelimited,
2452 )
2453 .encode(buf);
2454 ::buffa::types::encode_string(&self.name, buf);
2455 }
2456 if let Some(ref v) = self.new_name {
2457 ::buffa::encoding::Tag::new(
2458 2u32,
2459 ::buffa::encoding::WireType::LengthDelimited,
2460 )
2461 .encode(buf);
2462 ::buffa::types::encode_string(v, buf);
2463 }
2464 if let Some(ref v) = self.description {
2465 ::buffa::encoding::Tag::new(
2466 3u32,
2467 ::buffa::encoding::WireType::LengthDelimited,
2468 )
2469 .encode(buf);
2470 ::buffa::types::encode_string(v, buf);
2471 }
2472 for v in &self.allowed_tools {
2473 ::buffa::encoding::Tag::new(
2474 4u32,
2475 ::buffa::encoding::WireType::LengthDelimited,
2476 )
2477 .encode(buf);
2478 ::buffa::types::encode_string(v, buf);
2479 }
2480 if let Some(ref v) = self.comment {
2481 ::buffa::encoding::Tag::new(
2482 5u32,
2483 ::buffa::encoding::WireType::LengthDelimited,
2484 )
2485 .encode(buf);
2486 ::buffa::types::encode_string(v, buf);
2487 }
2488 if let Some(ref v) = self.owner {
2489 ::buffa::encoding::Tag::new(
2490 6u32,
2491 ::buffa::encoding::WireType::LengthDelimited,
2492 )
2493 .encode(buf);
2494 ::buffa::types::encode_string(v, buf);
2495 }
2496 self.__buffa_unknown_fields.write_to(buf);
2497 }
2498 fn merge_field(
2499 &mut self,
2500 tag: ::buffa::encoding::Tag,
2501 buf: &mut impl ::buffa::bytes::Buf,
2502 depth: u32,
2503 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2504 #[allow(unused_imports)]
2505 use ::buffa::bytes::Buf as _;
2506 #[allow(unused_imports)]
2507 use ::buffa::Enumeration as _;
2508 match tag.field_number() {
2509 1u32 => {
2510 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2511 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2512 field_number: 1u32,
2513 expected: 2u8,
2514 actual: tag.wire_type() as u8,
2515 });
2516 }
2517 ::buffa::types::merge_string(&mut self.name, buf)?;
2518 }
2519 2u32 => {
2520 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2521 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2522 field_number: 2u32,
2523 expected: 2u8,
2524 actual: tag.wire_type() as u8,
2525 });
2526 }
2527 ::buffa::types::merge_string(
2528 self
2529 .new_name
2530 .get_or_insert_with(::buffa::alloc::string::String::new),
2531 buf,
2532 )?;
2533 }
2534 3u32 => {
2535 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2536 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2537 field_number: 3u32,
2538 expected: 2u8,
2539 actual: tag.wire_type() as u8,
2540 });
2541 }
2542 ::buffa::types::merge_string(
2543 self
2544 .description
2545 .get_or_insert_with(::buffa::alloc::string::String::new),
2546 buf,
2547 )?;
2548 }
2549 4u32 => {
2550 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2551 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2552 field_number: 4u32,
2553 expected: 2u8,
2554 actual: tag.wire_type() as u8,
2555 });
2556 }
2557 self.allowed_tools.push(::buffa::types::decode_string(buf)?);
2558 }
2559 5u32 => {
2560 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2561 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2562 field_number: 5u32,
2563 expected: 2u8,
2564 actual: tag.wire_type() as u8,
2565 });
2566 }
2567 ::buffa::types::merge_string(
2568 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
2569 buf,
2570 )?;
2571 }
2572 6u32 => {
2573 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2574 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2575 field_number: 6u32,
2576 expected: 2u8,
2577 actual: tag.wire_type() as u8,
2578 });
2579 }
2580 ::buffa::types::merge_string(
2581 self.owner.get_or_insert_with(::buffa::alloc::string::String::new),
2582 buf,
2583 )?;
2584 }
2585 _ => {
2586 self.__buffa_unknown_fields
2587 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2588 }
2589 }
2590 ::core::result::Result::Ok(())
2591 }
2592 fn clear(&mut self) {
2593 self.name.clear();
2594 self.new_name = ::core::option::Option::None;
2595 self.description = ::core::option::Option::None;
2596 self.allowed_tools.clear();
2597 self.comment = ::core::option::Option::None;
2598 self.owner = ::core::option::Option::None;
2599 self.__buffa_unknown_fields.clear();
2600 }
2601}
2602impl ::buffa::ExtensionSet for UpdateAgentSkillRequest {
2603 const PROTO_FQN: &'static str = "unitycatalog.agent_skills.v0alpha1.UpdateAgentSkillRequest";
2604 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2605 &self.__buffa_unknown_fields
2606 }
2607 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2608 &mut self.__buffa_unknown_fields
2609 }
2610}
2611impl ::buffa::json_helpers::ProtoElemJson for UpdateAgentSkillRequest {
2612 fn serialize_proto_json<S: ::serde::Serializer>(
2613 v: &Self,
2614 s: S,
2615 ) -> ::core::result::Result<S::Ok, S::Error> {
2616 ::serde::Serialize::serialize(v, s)
2617 }
2618 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2619 d: D,
2620 ) -> ::core::result::Result<Self, D::Error> {
2621 <Self as ::serde::Deserialize>::deserialize(d)
2622 }
2623}
2624#[doc(hidden)]
2625pub const __UPDATE_AGENT_SKILL_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2626 type_url: "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.UpdateAgentSkillRequest",
2627 to_json: ::buffa::type_registry::any_to_json::<UpdateAgentSkillRequest>,
2628 from_json: ::buffa::type_registry::any_from_json::<UpdateAgentSkillRequest>,
2629 is_wkt: false,
2630};
2631#[derive(Clone, PartialEq, Default)]
2632#[derive(::serde::Serialize, ::serde::Deserialize)]
2633#[serde(default)]
2634pub struct DeleteAgentSkillRequest {
2635 #[serde(
2639 rename = "name",
2640 with = "::buffa::json_helpers::proto_string",
2641 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
2642 )]
2643 pub name: ::buffa::alloc::string::String,
2644 #[serde(skip)]
2645 #[doc(hidden)]
2646 pub __buffa_unknown_fields: ::buffa::UnknownFields,
2647}
2648impl ::core::fmt::Debug for DeleteAgentSkillRequest {
2649 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2650 f.debug_struct("DeleteAgentSkillRequest").field("name", &self.name).finish()
2651 }
2652}
2653impl DeleteAgentSkillRequest {
2654 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.DeleteAgentSkillRequest";
2659}
2660impl ::buffa::DefaultInstance for DeleteAgentSkillRequest {
2661 fn default_instance() -> &'static Self {
2662 static VALUE: ::buffa::__private::OnceBox<DeleteAgentSkillRequest> = ::buffa::__private::OnceBox::new();
2663 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2664 }
2665}
2666impl ::buffa::MessageName for DeleteAgentSkillRequest {
2667 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
2668 const NAME: &'static str = "DeleteAgentSkillRequest";
2669 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.DeleteAgentSkillRequest";
2670 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.DeleteAgentSkillRequest";
2671}
2672impl ::buffa::Message for DeleteAgentSkillRequest {
2673 #[allow(clippy::let_and_return)]
2679 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2680 #[allow(unused_imports)]
2681 use ::buffa::Enumeration as _;
2682 let mut size = 0u32;
2683 if !self.name.is_empty() {
2684 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
2685 }
2686 size += self.__buffa_unknown_fields.encoded_len() as u32;
2687 size
2688 }
2689 fn write_to(
2690 &self,
2691 _cache: &mut ::buffa::SizeCache,
2692 buf: &mut impl ::buffa::bytes::BufMut,
2693 ) {
2694 #[allow(unused_imports)]
2695 use ::buffa::Enumeration as _;
2696 if !self.name.is_empty() {
2697 ::buffa::encoding::Tag::new(
2698 1u32,
2699 ::buffa::encoding::WireType::LengthDelimited,
2700 )
2701 .encode(buf);
2702 ::buffa::types::encode_string(&self.name, buf);
2703 }
2704 self.__buffa_unknown_fields.write_to(buf);
2705 }
2706 fn merge_field(
2707 &mut self,
2708 tag: ::buffa::encoding::Tag,
2709 buf: &mut impl ::buffa::bytes::Buf,
2710 depth: u32,
2711 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2712 #[allow(unused_imports)]
2713 use ::buffa::bytes::Buf as _;
2714 #[allow(unused_imports)]
2715 use ::buffa::Enumeration as _;
2716 match tag.field_number() {
2717 1u32 => {
2718 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2719 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2720 field_number: 1u32,
2721 expected: 2u8,
2722 actual: tag.wire_type() as u8,
2723 });
2724 }
2725 ::buffa::types::merge_string(&mut self.name, buf)?;
2726 }
2727 _ => {
2728 self.__buffa_unknown_fields
2729 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2730 }
2731 }
2732 ::core::result::Result::Ok(())
2733 }
2734 fn clear(&mut self) {
2735 self.name.clear();
2736 self.__buffa_unknown_fields.clear();
2737 }
2738}
2739impl ::buffa::ExtensionSet for DeleteAgentSkillRequest {
2740 const PROTO_FQN: &'static str = "unitycatalog.agent_skills.v0alpha1.DeleteAgentSkillRequest";
2741 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2742 &self.__buffa_unknown_fields
2743 }
2744 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2745 &mut self.__buffa_unknown_fields
2746 }
2747}
2748impl ::buffa::json_helpers::ProtoElemJson for DeleteAgentSkillRequest {
2749 fn serialize_proto_json<S: ::serde::Serializer>(
2750 v: &Self,
2751 s: S,
2752 ) -> ::core::result::Result<S::Ok, S::Error> {
2753 ::serde::Serialize::serialize(v, s)
2754 }
2755 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2756 d: D,
2757 ) -> ::core::result::Result<Self, D::Error> {
2758 <Self as ::serde::Deserialize>::deserialize(d)
2759 }
2760}
2761#[doc(hidden)]
2762pub const __DELETE_AGENT_SKILL_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2763 type_url: "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.DeleteAgentSkillRequest",
2764 to_json: ::buffa::type_registry::any_to_json::<DeleteAgentSkillRequest>,
2765 from_json: ::buffa::type_registry::any_from_json::<DeleteAgentSkillRequest>,
2766 is_wkt: false,
2767};
2768#[allow(
2769 non_camel_case_types,
2770 dead_code,
2771 unused_imports,
2772 unused_qualifications,
2773 clippy::derivable_impls,
2774 clippy::match_single_binding,
2775 clippy::uninlined_format_args,
2776 clippy::doc_lazy_continuation,
2777 clippy::module_inception
2778)]
2779pub mod __buffa {
2780 #[allow(unused_imports)]
2781 use super::*;
2782 pub mod view {
2783 #[allow(unused_imports)]
2784 use super::*;
2785 #[derive(Clone, Debug, Default)]
2787 pub struct AgentSkillView<'a> {
2788 pub name: &'a str,
2797 pub catalog_name: &'a str,
2801 pub schema_name: &'a str,
2805 pub full_name: &'a str,
2809 pub storage_location: &'a str,
2814 pub agent_skill_id: &'a str,
2818 pub agent_skill_type: ::buffa::EnumValue<super::super::AgentSkillType>,
2822 pub description: ::core::option::Option<&'a str>,
2828 pub license: ::core::option::Option<&'a str>,
2832 pub allowed_tools: ::buffa::RepeatedView<'a, &'a str>,
2836 pub metadata: ::buffa::MapView<'a, &'a str, &'a str>,
2840 pub owner: ::core::option::Option<&'a str>,
2844 pub comment: ::core::option::Option<&'a str>,
2848 pub created_at: ::core::option::Option<i64>,
2852 pub created_by: ::core::option::Option<&'a str>,
2856 pub updated_at: ::core::option::Option<i64>,
2860 pub updated_by: ::core::option::Option<&'a str>,
2864 pub metastore_id: ::core::option::Option<&'a str>,
2868 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2869 }
2870 impl<'a> AgentSkillView<'a> {
2871 #[doc(hidden)]
2879 pub fn _decode_depth(
2880 buf: &'a [u8],
2881 depth: u32,
2882 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2883 let mut view = Self::default();
2884 view._merge_into_view(buf, depth)?;
2885 ::core::result::Result::Ok(view)
2886 }
2887 #[doc(hidden)]
2895 pub fn _merge_into_view(
2896 &mut self,
2897 buf: &'a [u8],
2898 depth: u32,
2899 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2900 let _ = depth;
2901 #[allow(unused_variables)]
2902 let view = self;
2903 let mut cur: &'a [u8] = buf;
2904 while !cur.is_empty() {
2905 let before_tag = cur;
2906 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
2907 match tag.field_number() {
2908 1u32 => {
2909 if tag.wire_type()
2910 != ::buffa::encoding::WireType::LengthDelimited
2911 {
2912 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2913 field_number: 1u32,
2914 expected: 2u8,
2915 actual: tag.wire_type() as u8,
2916 });
2917 }
2918 view.name = ::buffa::types::borrow_str(&mut cur)?;
2919 }
2920 2u32 => {
2921 if tag.wire_type()
2922 != ::buffa::encoding::WireType::LengthDelimited
2923 {
2924 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2925 field_number: 2u32,
2926 expected: 2u8,
2927 actual: tag.wire_type() as u8,
2928 });
2929 }
2930 view.catalog_name = ::buffa::types::borrow_str(&mut cur)?;
2931 }
2932 3u32 => {
2933 if tag.wire_type()
2934 != ::buffa::encoding::WireType::LengthDelimited
2935 {
2936 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2937 field_number: 3u32,
2938 expected: 2u8,
2939 actual: tag.wire_type() as u8,
2940 });
2941 }
2942 view.schema_name = ::buffa::types::borrow_str(&mut cur)?;
2943 }
2944 4u32 => {
2945 if tag.wire_type()
2946 != ::buffa::encoding::WireType::LengthDelimited
2947 {
2948 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2949 field_number: 4u32,
2950 expected: 2u8,
2951 actual: tag.wire_type() as u8,
2952 });
2953 }
2954 view.full_name = ::buffa::types::borrow_str(&mut cur)?;
2955 }
2956 5u32 => {
2957 if tag.wire_type()
2958 != ::buffa::encoding::WireType::LengthDelimited
2959 {
2960 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2961 field_number: 5u32,
2962 expected: 2u8,
2963 actual: tag.wire_type() as u8,
2964 });
2965 }
2966 view.storage_location = ::buffa::types::borrow_str(
2967 &mut cur,
2968 )?;
2969 }
2970 6u32 => {
2971 if tag.wire_type()
2972 != ::buffa::encoding::WireType::LengthDelimited
2973 {
2974 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2975 field_number: 6u32,
2976 expected: 2u8,
2977 actual: tag.wire_type() as u8,
2978 });
2979 }
2980 view.agent_skill_id = ::buffa::types::borrow_str(&mut cur)?;
2981 }
2982 7u32 => {
2983 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2984 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2985 field_number: 7u32,
2986 expected: 0u8,
2987 actual: tag.wire_type() as u8,
2988 });
2989 }
2990 view.agent_skill_type = ::buffa::EnumValue::from(
2991 ::buffa::types::decode_int32(&mut cur)?,
2992 );
2993 }
2994 8u32 => {
2995 if tag.wire_type()
2996 != ::buffa::encoding::WireType::LengthDelimited
2997 {
2998 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2999 field_number: 8u32,
3000 expected: 2u8,
3001 actual: tag.wire_type() as u8,
3002 });
3003 }
3004 view.description = Some(
3005 ::buffa::types::borrow_str(&mut cur)?,
3006 );
3007 }
3008 9u32 => {
3009 if tag.wire_type()
3010 != ::buffa::encoding::WireType::LengthDelimited
3011 {
3012 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3013 field_number: 9u32,
3014 expected: 2u8,
3015 actual: tag.wire_type() as u8,
3016 });
3017 }
3018 view.license = Some(::buffa::types::borrow_str(&mut cur)?);
3019 }
3020 12u32 => {
3021 if tag.wire_type()
3022 != ::buffa::encoding::WireType::LengthDelimited
3023 {
3024 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3025 field_number: 12u32,
3026 expected: 2u8,
3027 actual: tag.wire_type() as u8,
3028 });
3029 }
3030 view.owner = Some(::buffa::types::borrow_str(&mut cur)?);
3031 }
3032 13u32 => {
3033 if tag.wire_type()
3034 != ::buffa::encoding::WireType::LengthDelimited
3035 {
3036 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3037 field_number: 13u32,
3038 expected: 2u8,
3039 actual: tag.wire_type() as u8,
3040 });
3041 }
3042 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
3043 }
3044 1000u32 => {
3045 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3046 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3047 field_number: 1000u32,
3048 expected: 0u8,
3049 actual: tag.wire_type() as u8,
3050 });
3051 }
3052 view.created_at = Some(
3053 ::buffa::types::decode_int64(&mut cur)?,
3054 );
3055 }
3056 1001u32 => {
3057 if tag.wire_type()
3058 != ::buffa::encoding::WireType::LengthDelimited
3059 {
3060 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3061 field_number: 1001u32,
3062 expected: 2u8,
3063 actual: tag.wire_type() as u8,
3064 });
3065 }
3066 view.created_by = Some(
3067 ::buffa::types::borrow_str(&mut cur)?,
3068 );
3069 }
3070 1002u32 => {
3071 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3072 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3073 field_number: 1002u32,
3074 expected: 0u8,
3075 actual: tag.wire_type() as u8,
3076 });
3077 }
3078 view.updated_at = Some(
3079 ::buffa::types::decode_int64(&mut cur)?,
3080 );
3081 }
3082 1003u32 => {
3083 if tag.wire_type()
3084 != ::buffa::encoding::WireType::LengthDelimited
3085 {
3086 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3087 field_number: 1003u32,
3088 expected: 2u8,
3089 actual: tag.wire_type() as u8,
3090 });
3091 }
3092 view.updated_by = Some(
3093 ::buffa::types::borrow_str(&mut cur)?,
3094 );
3095 }
3096 1004u32 => {
3097 if tag.wire_type()
3098 != ::buffa::encoding::WireType::LengthDelimited
3099 {
3100 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3101 field_number: 1004u32,
3102 expected: 2u8,
3103 actual: tag.wire_type() as u8,
3104 });
3105 }
3106 view.metastore_id = Some(
3107 ::buffa::types::borrow_str(&mut cur)?,
3108 );
3109 }
3110 10u32 => {
3111 if tag.wire_type()
3112 != ::buffa::encoding::WireType::LengthDelimited
3113 {
3114 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3115 field_number: 10u32,
3116 expected: 2u8,
3117 actual: tag.wire_type() as u8,
3118 });
3119 }
3120 view.allowed_tools
3121 .push(::buffa::types::borrow_str(&mut cur)?);
3122 }
3123 11u32 => {
3124 if tag.wire_type()
3125 != ::buffa::encoding::WireType::LengthDelimited
3126 {
3127 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3128 field_number: 11u32,
3129 expected: 2u8,
3130 actual: tag.wire_type() as u8,
3131 });
3132 }
3133 let entry_bytes = ::buffa::types::borrow_bytes(&mut cur)?;
3134 let mut entry_cur: &'a [u8] = entry_bytes;
3135 let mut key = "";
3136 let mut val = "";
3137 while !entry_cur.is_empty() {
3138 let entry_tag = ::buffa::encoding::Tag::decode(
3139 &mut entry_cur,
3140 )?;
3141 match entry_tag.field_number() {
3142 1 => {
3143 if entry_tag.wire_type()
3144 != ::buffa::encoding::WireType::LengthDelimited
3145 {
3146 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3147 field_number: entry_tag.field_number(),
3148 expected: 2u8,
3149 actual: entry_tag.wire_type() as u8,
3150 });
3151 }
3152 key = ::buffa::types::borrow_str(&mut entry_cur)?;
3153 }
3154 2 => {
3155 if entry_tag.wire_type()
3156 != ::buffa::encoding::WireType::LengthDelimited
3157 {
3158 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3159 field_number: entry_tag.field_number(),
3160 expected: 2u8,
3161 actual: entry_tag.wire_type() as u8,
3162 });
3163 }
3164 val = ::buffa::types::borrow_str(&mut entry_cur)?;
3165 }
3166 _ => {
3167 ::buffa::encoding::skip_field_depth(
3168 entry_tag,
3169 &mut entry_cur,
3170 depth,
3171 )?;
3172 }
3173 }
3174 }
3175 view.metadata.push(key, val);
3176 }
3177 _ => {
3178 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
3179 let span_len = before_tag.len() - cur.len();
3180 view.__buffa_unknown_fields
3181 .push_raw(&before_tag[..span_len]);
3182 }
3183 }
3184 }
3185 ::core::result::Result::Ok(())
3186 }
3187 }
3188 impl<'a> ::buffa::MessageView<'a> for AgentSkillView<'a> {
3189 type Owned = super::super::AgentSkill;
3190 fn decode_view(
3191 buf: &'a [u8],
3192 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3193 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
3194 }
3195 fn decode_view_with_limit(
3196 buf: &'a [u8],
3197 depth: u32,
3198 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3199 Self::_decode_depth(buf, depth)
3200 }
3201 fn to_owned_message(&self) -> super::super::AgentSkill {
3202 self.to_owned_from_source(None)
3203 }
3204 #[allow(clippy::useless_conversion, clippy::needless_update)]
3205 fn to_owned_from_source(
3206 &self,
3207 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3208 ) -> super::super::AgentSkill {
3209 #[allow(unused_imports)]
3210 use ::buffa::alloc::string::ToString as _;
3211 let _ = __buffa_src;
3212 super::super::AgentSkill {
3213 name: self.name.to_string(),
3214 catalog_name: self.catalog_name.to_string(),
3215 schema_name: self.schema_name.to_string(),
3216 full_name: self.full_name.to_string(),
3217 storage_location: self.storage_location.to_string(),
3218 agent_skill_id: self.agent_skill_id.to_string(),
3219 agent_skill_type: self.agent_skill_type,
3220 description: self.description.map(|s| s.to_string()),
3221 license: self.license.map(|s| s.to_string()),
3222 allowed_tools: self
3223 .allowed_tools
3224 .iter()
3225 .map(|s| s.to_string())
3226 .collect(),
3227 metadata: self
3228 .metadata
3229 .iter()
3230 .map(|(k, v)| (k.to_string(), v.to_string()))
3231 .collect(),
3232 owner: self.owner.map(|s| s.to_string()),
3233 comment: self.comment.map(|s| s.to_string()),
3234 created_at: self.created_at,
3235 created_by: self.created_by.map(|s| s.to_string()),
3236 updated_at: self.updated_at,
3237 updated_by: self.updated_by.map(|s| s.to_string()),
3238 metastore_id: self.metastore_id.map(|s| s.to_string()),
3239 __buffa_unknown_fields: self
3240 .__buffa_unknown_fields
3241 .to_owned()
3242 .unwrap_or_default()
3243 .into(),
3244 ..::core::default::Default::default()
3245 }
3246 }
3247 }
3248 impl<'a> ::buffa::ViewEncode<'a> for AgentSkillView<'a> {
3249 #[allow(clippy::needless_borrow, clippy::let_and_return)]
3250 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3251 #[allow(unused_imports)]
3252 use ::buffa::Enumeration as _;
3253 let mut size = 0u32;
3254 if !self.name.is_empty() {
3255 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
3256 }
3257 if !self.catalog_name.is_empty() {
3258 size
3259 += 1u32
3260 + ::buffa::types::string_encoded_len(&self.catalog_name)
3261 as u32;
3262 }
3263 if !self.schema_name.is_empty() {
3264 size
3265 += 1u32
3266 + ::buffa::types::string_encoded_len(&self.schema_name)
3267 as u32;
3268 }
3269 if !self.full_name.is_empty() {
3270 size
3271 += 1u32
3272 + ::buffa::types::string_encoded_len(&self.full_name) as u32;
3273 }
3274 if !self.storage_location.is_empty() {
3275 size
3276 += 1u32
3277 + ::buffa::types::string_encoded_len(&self.storage_location)
3278 as u32;
3279 }
3280 if !self.agent_skill_id.is_empty() {
3281 size
3282 += 1u32
3283 + ::buffa::types::string_encoded_len(&self.agent_skill_id)
3284 as u32;
3285 }
3286 {
3287 let val = self.agent_skill_type.to_i32();
3288 if val != 0 {
3289 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
3290 }
3291 }
3292 if let Some(ref v) = self.description {
3293 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3294 }
3295 if let Some(ref v) = self.license {
3296 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3297 }
3298 for v in &self.allowed_tools {
3299 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3300 }
3301 #[allow(clippy::for_kv_map)]
3302 for (k, v) in &self.metadata {
3303 let entry_size: u32 = 1u32
3304 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
3305 + ::buffa::types::string_encoded_len(v) as u32;
3306 size
3307 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
3308 + entry_size;
3309 }
3310 if let Some(ref v) = self.owner {
3311 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3312 }
3313 if let Some(ref v) = self.comment {
3314 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3315 }
3316 if let Some(v) = self.created_at {
3317 size += 2u32 + ::buffa::types::int64_encoded_len(v) as u32;
3318 }
3319 if let Some(ref v) = self.created_by {
3320 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
3321 }
3322 if let Some(v) = self.updated_at {
3323 size += 2u32 + ::buffa::types::int64_encoded_len(v) as u32;
3324 }
3325 if let Some(ref v) = self.updated_by {
3326 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
3327 }
3328 if let Some(ref v) = self.metastore_id {
3329 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
3330 }
3331 size += self.__buffa_unknown_fields.encoded_len() as u32;
3332 size
3333 }
3334 #[allow(clippy::needless_borrow)]
3335 fn write_to(
3336 &self,
3337 _cache: &mut ::buffa::SizeCache,
3338 buf: &mut impl ::buffa::bytes::BufMut,
3339 ) {
3340 #[allow(unused_imports)]
3341 use ::buffa::Enumeration as _;
3342 if !self.name.is_empty() {
3343 ::buffa::encoding::Tag::new(
3344 1u32,
3345 ::buffa::encoding::WireType::LengthDelimited,
3346 )
3347 .encode(buf);
3348 ::buffa::types::encode_string(&self.name, buf);
3349 }
3350 if !self.catalog_name.is_empty() {
3351 ::buffa::encoding::Tag::new(
3352 2u32,
3353 ::buffa::encoding::WireType::LengthDelimited,
3354 )
3355 .encode(buf);
3356 ::buffa::types::encode_string(&self.catalog_name, buf);
3357 }
3358 if !self.schema_name.is_empty() {
3359 ::buffa::encoding::Tag::new(
3360 3u32,
3361 ::buffa::encoding::WireType::LengthDelimited,
3362 )
3363 .encode(buf);
3364 ::buffa::types::encode_string(&self.schema_name, buf);
3365 }
3366 if !self.full_name.is_empty() {
3367 ::buffa::encoding::Tag::new(
3368 4u32,
3369 ::buffa::encoding::WireType::LengthDelimited,
3370 )
3371 .encode(buf);
3372 ::buffa::types::encode_string(&self.full_name, buf);
3373 }
3374 if !self.storage_location.is_empty() {
3375 ::buffa::encoding::Tag::new(
3376 5u32,
3377 ::buffa::encoding::WireType::LengthDelimited,
3378 )
3379 .encode(buf);
3380 ::buffa::types::encode_string(&self.storage_location, buf);
3381 }
3382 if !self.agent_skill_id.is_empty() {
3383 ::buffa::encoding::Tag::new(
3384 6u32,
3385 ::buffa::encoding::WireType::LengthDelimited,
3386 )
3387 .encode(buf);
3388 ::buffa::types::encode_string(&self.agent_skill_id, buf);
3389 }
3390 {
3391 let val = self.agent_skill_type.to_i32();
3392 if val != 0 {
3393 ::buffa::encoding::Tag::new(
3394 7u32,
3395 ::buffa::encoding::WireType::Varint,
3396 )
3397 .encode(buf);
3398 ::buffa::types::encode_int32(val, buf);
3399 }
3400 }
3401 if let Some(ref v) = self.description {
3402 ::buffa::encoding::Tag::new(
3403 8u32,
3404 ::buffa::encoding::WireType::LengthDelimited,
3405 )
3406 .encode(buf);
3407 ::buffa::types::encode_string(v, buf);
3408 }
3409 if let Some(ref v) = self.license {
3410 ::buffa::encoding::Tag::new(
3411 9u32,
3412 ::buffa::encoding::WireType::LengthDelimited,
3413 )
3414 .encode(buf);
3415 ::buffa::types::encode_string(v, buf);
3416 }
3417 for v in &self.allowed_tools {
3418 ::buffa::encoding::Tag::new(
3419 10u32,
3420 ::buffa::encoding::WireType::LengthDelimited,
3421 )
3422 .encode(buf);
3423 ::buffa::types::encode_string(v, buf);
3424 }
3425 for (k, v) in &self.metadata {
3426 let entry_size: u32 = 1u32
3427 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
3428 + ::buffa::types::string_encoded_len(v) as u32;
3429 ::buffa::encoding::Tag::new(
3430 11u32,
3431 ::buffa::encoding::WireType::LengthDelimited,
3432 )
3433 .encode(buf);
3434 ::buffa::encoding::encode_varint(entry_size as u64, buf);
3435 ::buffa::encoding::Tag::new(
3436 1u32,
3437 ::buffa::encoding::WireType::LengthDelimited,
3438 )
3439 .encode(buf);
3440 ::buffa::types::encode_string(k, buf);
3441 ::buffa::encoding::Tag::new(
3442 2u32,
3443 ::buffa::encoding::WireType::LengthDelimited,
3444 )
3445 .encode(buf);
3446 ::buffa::types::encode_string(v, buf);
3447 }
3448 if let Some(ref v) = self.owner {
3449 ::buffa::encoding::Tag::new(
3450 12u32,
3451 ::buffa::encoding::WireType::LengthDelimited,
3452 )
3453 .encode(buf);
3454 ::buffa::types::encode_string(v, buf);
3455 }
3456 if let Some(ref v) = self.comment {
3457 ::buffa::encoding::Tag::new(
3458 13u32,
3459 ::buffa::encoding::WireType::LengthDelimited,
3460 )
3461 .encode(buf);
3462 ::buffa::types::encode_string(v, buf);
3463 }
3464 if let Some(v) = self.created_at {
3465 ::buffa::encoding::Tag::new(
3466 1000u32,
3467 ::buffa::encoding::WireType::Varint,
3468 )
3469 .encode(buf);
3470 ::buffa::types::encode_int64(v, buf);
3471 }
3472 if let Some(ref v) = self.created_by {
3473 ::buffa::encoding::Tag::new(
3474 1001u32,
3475 ::buffa::encoding::WireType::LengthDelimited,
3476 )
3477 .encode(buf);
3478 ::buffa::types::encode_string(v, buf);
3479 }
3480 if let Some(v) = self.updated_at {
3481 ::buffa::encoding::Tag::new(
3482 1002u32,
3483 ::buffa::encoding::WireType::Varint,
3484 )
3485 .encode(buf);
3486 ::buffa::types::encode_int64(v, buf);
3487 }
3488 if let Some(ref v) = self.updated_by {
3489 ::buffa::encoding::Tag::new(
3490 1003u32,
3491 ::buffa::encoding::WireType::LengthDelimited,
3492 )
3493 .encode(buf);
3494 ::buffa::types::encode_string(v, buf);
3495 }
3496 if let Some(ref v) = self.metastore_id {
3497 ::buffa::encoding::Tag::new(
3498 1004u32,
3499 ::buffa::encoding::WireType::LengthDelimited,
3500 )
3501 .encode(buf);
3502 ::buffa::types::encode_string(v, buf);
3503 }
3504 self.__buffa_unknown_fields.write_to(buf);
3505 }
3506 }
3507 impl<'__a> ::serde::Serialize for AgentSkillView<'__a> {
3519 fn serialize<__S: ::serde::Serializer>(
3520 &self,
3521 __s: __S,
3522 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3523 use ::serde::ser::SerializeMap as _;
3524 let mut __map = __s.serialize_map(::core::option::Option::None)?;
3525 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
3526 __map.serialize_entry("name", self.name)?;
3527 }
3528 if !::buffa::json_helpers::skip_if::is_empty_str(self.catalog_name) {
3529 __map.serialize_entry("catalog_name", self.catalog_name)?;
3530 }
3531 if !::buffa::json_helpers::skip_if::is_empty_str(self.schema_name) {
3532 __map.serialize_entry("schema_name", self.schema_name)?;
3533 }
3534 if !::buffa::json_helpers::skip_if::is_empty_str(self.full_name) {
3535 __map.serialize_entry("full_name", self.full_name)?;
3536 }
3537 if !::buffa::json_helpers::skip_if::is_empty_str(self.storage_location) {
3538 __map.serialize_entry("storage_location", self.storage_location)?;
3539 }
3540 if !::buffa::json_helpers::skip_if::is_empty_str(self.agent_skill_id) {
3541 __map.serialize_entry("agent_skill_id", self.agent_skill_id)?;
3542 }
3543 if !::buffa::json_helpers::skip_if::is_default_enum_value(
3544 &self.agent_skill_type,
3545 ) {
3546 __map.serialize_entry("agent_skill_type", &self.agent_skill_type)?;
3547 }
3548 if let ::core::option::Option::Some(__v) = self.description {
3549 __map.serialize_entry("description", __v)?;
3550 }
3551 if let ::core::option::Option::Some(__v) = self.license {
3552 __map.serialize_entry("license", __v)?;
3553 }
3554 if !self.allowed_tools.is_empty() {
3555 __map.serialize_entry("allowed_tools", &*self.allowed_tools)?;
3556 }
3557 if !self.metadata.is_empty() {
3558 struct _WM<'__a, '__x>(
3559 &'__x ::buffa::MapView<'__x, &'__a str, &'__a str>,
3560 );
3561 impl<'__a> ::serde::Serialize for _WM<'__a, '_> {
3562 fn serialize<__S: ::serde::Serializer>(
3563 &self,
3564 __s: __S,
3565 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3566 use ::serde::ser::SerializeMap as _;
3567 let mut __m = __s
3568 .serialize_map(::core::option::Option::Some(self.0.len()))?;
3569 for (k, v) in self.0.iter_unique() {
3570 __m.serialize_entry(k, v)?;
3571 }
3572 __m.end()
3573 }
3574 }
3575 __map.serialize_entry("metadata", &_WM(&self.metadata))?;
3576 }
3577 if let ::core::option::Option::Some(__v) = self.owner {
3578 __map.serialize_entry("owner", __v)?;
3579 }
3580 if let ::core::option::Option::Some(__v) = self.comment {
3581 __map.serialize_entry("comment", __v)?;
3582 }
3583 if let ::core::option::Option::Some(__v) = self.created_at {
3584 struct _W(i64);
3585 impl ::serde::Serialize for _W {
3586 fn serialize<__S: ::serde::Serializer>(
3587 &self,
3588 __s: __S,
3589 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3590 ::buffa::json_helpers::int64::serialize(&self.0, __s)
3591 }
3592 }
3593 __map.serialize_entry("created_at", &_W(__v))?;
3594 }
3595 if let ::core::option::Option::Some(__v) = self.created_by {
3596 __map.serialize_entry("created_by", __v)?;
3597 }
3598 if let ::core::option::Option::Some(__v) = self.updated_at {
3599 struct _W(i64);
3600 impl ::serde::Serialize for _W {
3601 fn serialize<__S: ::serde::Serializer>(
3602 &self,
3603 __s: __S,
3604 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3605 ::buffa::json_helpers::int64::serialize(&self.0, __s)
3606 }
3607 }
3608 __map.serialize_entry("updated_at", &_W(__v))?;
3609 }
3610 if let ::core::option::Option::Some(__v) = self.updated_by {
3611 __map.serialize_entry("updated_by", __v)?;
3612 }
3613 if let ::core::option::Option::Some(__v) = self.metastore_id {
3614 __map.serialize_entry("metastore_id", __v)?;
3615 }
3616 __map.end()
3617 }
3618 }
3619 impl<'a> ::buffa::MessageName for AgentSkillView<'a> {
3620 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
3621 const NAME: &'static str = "AgentSkill";
3622 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.AgentSkill";
3623 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.AgentSkill";
3624 }
3625 impl<'v> ::buffa::DefaultViewInstance for AgentSkillView<'v> {
3626 fn default_view_instance<'a>() -> &'a Self
3627 where
3628 Self: 'a,
3629 {
3630 static VALUE: ::buffa::__private::OnceBox<AgentSkillView<'static>> = ::buffa::__private::OnceBox::new();
3631 VALUE
3632 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
3633 <AgentSkillView<'static>>::default(),
3634 ))
3635 }
3636 }
3637 impl ::buffa::ViewReborrow for AgentSkillView<'static> {
3638 type Reborrowed<'b> = AgentSkillView<'b>;
3639 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
3640 this
3641 }
3642 }
3643 #[derive(Clone, Debug)]
3649 pub struct AgentSkillOwnedView(::buffa::OwnedView<AgentSkillView<'static>>);
3650 impl AgentSkillOwnedView {
3651 pub fn decode(
3661 bytes: ::buffa::bytes::Bytes,
3662 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3663 ::core::result::Result::Ok(
3664 AgentSkillOwnedView(::buffa::OwnedView::decode(bytes)?),
3665 )
3666 }
3667 pub fn decode_with_options(
3675 bytes: ::buffa::bytes::Bytes,
3676 opts: &::buffa::DecodeOptions,
3677 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3678 ::core::result::Result::Ok(
3679 AgentSkillOwnedView(
3680 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
3681 ),
3682 )
3683 }
3684 pub fn from_owned(
3691 msg: &super::super::AgentSkill,
3692 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3693 ::core::result::Result::Ok(
3694 AgentSkillOwnedView(::buffa::OwnedView::from_owned(msg)?),
3695 )
3696 }
3697 #[must_use]
3699 pub fn view(&self) -> &AgentSkillView<'_> {
3700 self.0.reborrow()
3701 }
3702 #[must_use]
3704 pub fn to_owned_message(&self) -> super::super::AgentSkill {
3705 self.0.to_owned_message()
3706 }
3707 #[must_use]
3709 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3710 self.0.bytes()
3711 }
3712 #[must_use]
3714 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3715 self.0.into_bytes()
3716 }
3717 #[must_use]
3726 pub fn name(&self) -> &'_ str {
3727 self.0.reborrow().name
3728 }
3729 #[must_use]
3733 pub fn catalog_name(&self) -> &'_ str {
3734 self.0.reborrow().catalog_name
3735 }
3736 #[must_use]
3740 pub fn schema_name(&self) -> &'_ str {
3741 self.0.reborrow().schema_name
3742 }
3743 #[must_use]
3747 pub fn full_name(&self) -> &'_ str {
3748 self.0.reborrow().full_name
3749 }
3750 #[must_use]
3755 pub fn storage_location(&self) -> &'_ str {
3756 self.0.reborrow().storage_location
3757 }
3758 #[must_use]
3762 pub fn agent_skill_id(&self) -> &'_ str {
3763 self.0.reborrow().agent_skill_id
3764 }
3765 #[must_use]
3769 pub fn agent_skill_type(
3770 &self,
3771 ) -> ::buffa::EnumValue<super::super::AgentSkillType> {
3772 self.0.reborrow().agent_skill_type
3773 }
3774 #[must_use]
3780 pub fn description(&self) -> ::core::option::Option<&'_ str> {
3781 self.0.reborrow().description
3782 }
3783 #[must_use]
3787 pub fn license(&self) -> ::core::option::Option<&'_ str> {
3788 self.0.reborrow().license
3789 }
3790 #[must_use]
3794 pub fn allowed_tools(&self) -> &::buffa::RepeatedView<'_, &'_ str> {
3795 &self.0.reborrow().allowed_tools
3796 }
3797 #[must_use]
3801 pub fn metadata(&self) -> &::buffa::MapView<'_, &'_ str, &'_ str> {
3802 &self.0.reborrow().metadata
3803 }
3804 #[must_use]
3808 pub fn owner(&self) -> ::core::option::Option<&'_ str> {
3809 self.0.reborrow().owner
3810 }
3811 #[must_use]
3815 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
3816 self.0.reborrow().comment
3817 }
3818 #[must_use]
3822 pub fn created_at(&self) -> ::core::option::Option<i64> {
3823 self.0.reborrow().created_at
3824 }
3825 #[must_use]
3829 pub fn created_by(&self) -> ::core::option::Option<&'_ str> {
3830 self.0.reborrow().created_by
3831 }
3832 #[must_use]
3836 pub fn updated_at(&self) -> ::core::option::Option<i64> {
3837 self.0.reborrow().updated_at
3838 }
3839 #[must_use]
3843 pub fn updated_by(&self) -> ::core::option::Option<&'_ str> {
3844 self.0.reborrow().updated_by
3845 }
3846 #[must_use]
3850 pub fn metastore_id(&self) -> ::core::option::Option<&'_ str> {
3851 self.0.reborrow().metastore_id
3852 }
3853 }
3854 impl ::core::convert::From<::buffa::OwnedView<AgentSkillView<'static>>>
3855 for AgentSkillOwnedView {
3856 fn from(inner: ::buffa::OwnedView<AgentSkillView<'static>>) -> Self {
3857 AgentSkillOwnedView(inner)
3858 }
3859 }
3860 impl ::core::convert::From<AgentSkillOwnedView>
3861 for ::buffa::OwnedView<AgentSkillView<'static>> {
3862 fn from(wrapper: AgentSkillOwnedView) -> Self {
3863 wrapper.0
3864 }
3865 }
3866 impl ::core::convert::AsRef<::buffa::OwnedView<AgentSkillView<'static>>>
3867 for AgentSkillOwnedView {
3868 fn as_ref(&self) -> &::buffa::OwnedView<AgentSkillView<'static>> {
3869 &self.0
3870 }
3871 }
3872 impl ::buffa::HasMessageView for super::super::AgentSkill {
3873 type View<'a> = AgentSkillView<'a>;
3874 type ViewHandle = AgentSkillOwnedView;
3875 }
3876 impl ::serde::Serialize for AgentSkillOwnedView {
3877 fn serialize<__S: ::serde::Serializer>(
3878 &self,
3879 __s: __S,
3880 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3881 ::serde::Serialize::serialize(&self.0, __s)
3882 }
3883 }
3884 #[derive(Clone, Debug, Default)]
3886 pub struct ListAgentSkillsRequestView<'a> {
3887 pub catalog_name: &'a str,
3891 pub schema_name: &'a str,
3895 pub max_results: ::core::option::Option<i32>,
3899 pub page_token: ::core::option::Option<&'a str>,
3903 pub include_browse: ::core::option::Option<bool>,
3908 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
3909 }
3910 impl<'a> ListAgentSkillsRequestView<'a> {
3911 #[doc(hidden)]
3919 pub fn _decode_depth(
3920 buf: &'a [u8],
3921 depth: u32,
3922 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3923 let mut view = Self::default();
3924 view._merge_into_view(buf, depth)?;
3925 ::core::result::Result::Ok(view)
3926 }
3927 #[doc(hidden)]
3935 pub fn _merge_into_view(
3936 &mut self,
3937 buf: &'a [u8],
3938 depth: u32,
3939 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3940 let _ = depth;
3941 #[allow(unused_variables)]
3942 let view = self;
3943 let mut cur: &'a [u8] = buf;
3944 while !cur.is_empty() {
3945 let before_tag = cur;
3946 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
3947 match tag.field_number() {
3948 1u32 => {
3949 if tag.wire_type()
3950 != ::buffa::encoding::WireType::LengthDelimited
3951 {
3952 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3953 field_number: 1u32,
3954 expected: 2u8,
3955 actual: tag.wire_type() as u8,
3956 });
3957 }
3958 view.catalog_name = ::buffa::types::borrow_str(&mut cur)?;
3959 }
3960 2u32 => {
3961 if tag.wire_type()
3962 != ::buffa::encoding::WireType::LengthDelimited
3963 {
3964 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3965 field_number: 2u32,
3966 expected: 2u8,
3967 actual: tag.wire_type() as u8,
3968 });
3969 }
3970 view.schema_name = ::buffa::types::borrow_str(&mut cur)?;
3971 }
3972 3u32 => {
3973 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3974 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3975 field_number: 3u32,
3976 expected: 0u8,
3977 actual: tag.wire_type() as u8,
3978 });
3979 }
3980 view.max_results = Some(
3981 ::buffa::types::decode_int32(&mut cur)?,
3982 );
3983 }
3984 4u32 => {
3985 if tag.wire_type()
3986 != ::buffa::encoding::WireType::LengthDelimited
3987 {
3988 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3989 field_number: 4u32,
3990 expected: 2u8,
3991 actual: tag.wire_type() as u8,
3992 });
3993 }
3994 view.page_token = Some(
3995 ::buffa::types::borrow_str(&mut cur)?,
3996 );
3997 }
3998 5u32 => {
3999 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4000 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4001 field_number: 5u32,
4002 expected: 0u8,
4003 actual: tag.wire_type() as u8,
4004 });
4005 }
4006 view.include_browse = Some(
4007 ::buffa::types::decode_bool(&mut cur)?,
4008 );
4009 }
4010 _ => {
4011 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4012 let span_len = before_tag.len() - cur.len();
4013 view.__buffa_unknown_fields
4014 .push_raw(&before_tag[..span_len]);
4015 }
4016 }
4017 }
4018 ::core::result::Result::Ok(())
4019 }
4020 }
4021 impl<'a> ::buffa::MessageView<'a> for ListAgentSkillsRequestView<'a> {
4022 type Owned = super::super::ListAgentSkillsRequest;
4023 fn decode_view(
4024 buf: &'a [u8],
4025 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4026 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
4027 }
4028 fn decode_view_with_limit(
4029 buf: &'a [u8],
4030 depth: u32,
4031 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4032 Self::_decode_depth(buf, depth)
4033 }
4034 fn to_owned_message(&self) -> super::super::ListAgentSkillsRequest {
4035 self.to_owned_from_source(None)
4036 }
4037 #[allow(clippy::useless_conversion, clippy::needless_update)]
4038 fn to_owned_from_source(
4039 &self,
4040 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4041 ) -> super::super::ListAgentSkillsRequest {
4042 #[allow(unused_imports)]
4043 use ::buffa::alloc::string::ToString as _;
4044 let _ = __buffa_src;
4045 super::super::ListAgentSkillsRequest {
4046 catalog_name: self.catalog_name.to_string(),
4047 schema_name: self.schema_name.to_string(),
4048 max_results: self.max_results,
4049 page_token: self.page_token.map(|s| s.to_string()),
4050 include_browse: self.include_browse,
4051 __buffa_unknown_fields: self
4052 .__buffa_unknown_fields
4053 .to_owned()
4054 .unwrap_or_default()
4055 .into(),
4056 ..::core::default::Default::default()
4057 }
4058 }
4059 }
4060 impl<'a> ::buffa::ViewEncode<'a> for ListAgentSkillsRequestView<'a> {
4061 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4062 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
4063 #[allow(unused_imports)]
4064 use ::buffa::Enumeration as _;
4065 let mut size = 0u32;
4066 if !self.catalog_name.is_empty() {
4067 size
4068 += 1u32
4069 + ::buffa::types::string_encoded_len(&self.catalog_name)
4070 as u32;
4071 }
4072 if !self.schema_name.is_empty() {
4073 size
4074 += 1u32
4075 + ::buffa::types::string_encoded_len(&self.schema_name)
4076 as u32;
4077 }
4078 if let Some(v) = self.max_results {
4079 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
4080 }
4081 if let Some(ref v) = self.page_token {
4082 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4083 }
4084 if self.include_browse.is_some() {
4085 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
4086 }
4087 size += self.__buffa_unknown_fields.encoded_len() as u32;
4088 size
4089 }
4090 #[allow(clippy::needless_borrow)]
4091 fn write_to(
4092 &self,
4093 _cache: &mut ::buffa::SizeCache,
4094 buf: &mut impl ::buffa::bytes::BufMut,
4095 ) {
4096 #[allow(unused_imports)]
4097 use ::buffa::Enumeration as _;
4098 if !self.catalog_name.is_empty() {
4099 ::buffa::encoding::Tag::new(
4100 1u32,
4101 ::buffa::encoding::WireType::LengthDelimited,
4102 )
4103 .encode(buf);
4104 ::buffa::types::encode_string(&self.catalog_name, buf);
4105 }
4106 if !self.schema_name.is_empty() {
4107 ::buffa::encoding::Tag::new(
4108 2u32,
4109 ::buffa::encoding::WireType::LengthDelimited,
4110 )
4111 .encode(buf);
4112 ::buffa::types::encode_string(&self.schema_name, buf);
4113 }
4114 if let Some(v) = self.max_results {
4115 ::buffa::encoding::Tag::new(
4116 3u32,
4117 ::buffa::encoding::WireType::Varint,
4118 )
4119 .encode(buf);
4120 ::buffa::types::encode_int32(v, buf);
4121 }
4122 if let Some(ref v) = self.page_token {
4123 ::buffa::encoding::Tag::new(
4124 4u32,
4125 ::buffa::encoding::WireType::LengthDelimited,
4126 )
4127 .encode(buf);
4128 ::buffa::types::encode_string(v, buf);
4129 }
4130 if let Some(v) = self.include_browse {
4131 ::buffa::encoding::Tag::new(
4132 5u32,
4133 ::buffa::encoding::WireType::Varint,
4134 )
4135 .encode(buf);
4136 ::buffa::types::encode_bool(v, buf);
4137 }
4138 self.__buffa_unknown_fields.write_to(buf);
4139 }
4140 }
4141 impl<'__a> ::serde::Serialize for ListAgentSkillsRequestView<'__a> {
4153 fn serialize<__S: ::serde::Serializer>(
4154 &self,
4155 __s: __S,
4156 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4157 use ::serde::ser::SerializeMap as _;
4158 let mut __map = __s.serialize_map(::core::option::Option::None)?;
4159 if !::buffa::json_helpers::skip_if::is_empty_str(self.catalog_name) {
4160 __map.serialize_entry("catalog_name", self.catalog_name)?;
4161 }
4162 if !::buffa::json_helpers::skip_if::is_empty_str(self.schema_name) {
4163 __map.serialize_entry("schema_name", self.schema_name)?;
4164 }
4165 if let ::core::option::Option::Some(__v) = self.max_results {
4166 struct _W(i32);
4167 impl ::serde::Serialize for _W {
4168 fn serialize<__S: ::serde::Serializer>(
4169 &self,
4170 __s: __S,
4171 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4172 ::buffa::json_helpers::int32::serialize(&self.0, __s)
4173 }
4174 }
4175 __map.serialize_entry("max_results", &_W(__v))?;
4176 }
4177 if let ::core::option::Option::Some(__v) = self.page_token {
4178 __map.serialize_entry("page_token", __v)?;
4179 }
4180 if let ::core::option::Option::Some(__v) = self.include_browse {
4181 __map.serialize_entry("include_browse", &__v)?;
4182 }
4183 __map.end()
4184 }
4185 }
4186 impl<'a> ::buffa::MessageName for ListAgentSkillsRequestView<'a> {
4187 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
4188 const NAME: &'static str = "ListAgentSkillsRequest";
4189 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.ListAgentSkillsRequest";
4190 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.ListAgentSkillsRequest";
4191 }
4192 impl<'v> ::buffa::DefaultViewInstance for ListAgentSkillsRequestView<'v> {
4193 fn default_view_instance<'a>() -> &'a Self
4194 where
4195 Self: 'a,
4196 {
4197 static VALUE: ::buffa::__private::OnceBox<
4198 ListAgentSkillsRequestView<'static>,
4199 > = ::buffa::__private::OnceBox::new();
4200 VALUE
4201 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
4202 <ListAgentSkillsRequestView<'static>>::default(),
4203 ))
4204 }
4205 }
4206 impl ::buffa::ViewReborrow for ListAgentSkillsRequestView<'static> {
4207 type Reborrowed<'b> = ListAgentSkillsRequestView<'b>;
4208 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
4209 this
4210 }
4211 }
4212 #[derive(Clone, Debug)]
4218 pub struct ListAgentSkillsRequestOwnedView(
4219 ::buffa::OwnedView<ListAgentSkillsRequestView<'static>>,
4220 );
4221 impl ListAgentSkillsRequestOwnedView {
4222 pub fn decode(
4232 bytes: ::buffa::bytes::Bytes,
4233 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4234 ::core::result::Result::Ok(
4235 ListAgentSkillsRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
4236 )
4237 }
4238 pub fn decode_with_options(
4246 bytes: ::buffa::bytes::Bytes,
4247 opts: &::buffa::DecodeOptions,
4248 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4249 ::core::result::Result::Ok(
4250 ListAgentSkillsRequestOwnedView(
4251 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4252 ),
4253 )
4254 }
4255 pub fn from_owned(
4262 msg: &super::super::ListAgentSkillsRequest,
4263 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4264 ::core::result::Result::Ok(
4265 ListAgentSkillsRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
4266 )
4267 }
4268 #[must_use]
4270 pub fn view(&self) -> &ListAgentSkillsRequestView<'_> {
4271 self.0.reborrow()
4272 }
4273 #[must_use]
4275 pub fn to_owned_message(&self) -> super::super::ListAgentSkillsRequest {
4276 self.0.to_owned_message()
4277 }
4278 #[must_use]
4280 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4281 self.0.bytes()
4282 }
4283 #[must_use]
4285 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4286 self.0.into_bytes()
4287 }
4288 #[must_use]
4292 pub fn catalog_name(&self) -> &'_ str {
4293 self.0.reborrow().catalog_name
4294 }
4295 #[must_use]
4299 pub fn schema_name(&self) -> &'_ str {
4300 self.0.reborrow().schema_name
4301 }
4302 #[must_use]
4306 pub fn max_results(&self) -> ::core::option::Option<i32> {
4307 self.0.reborrow().max_results
4308 }
4309 #[must_use]
4313 pub fn page_token(&self) -> ::core::option::Option<&'_ str> {
4314 self.0.reborrow().page_token
4315 }
4316 #[must_use]
4321 pub fn include_browse(&self) -> ::core::option::Option<bool> {
4322 self.0.reborrow().include_browse
4323 }
4324 }
4325 impl ::core::convert::From<
4326 ::buffa::OwnedView<ListAgentSkillsRequestView<'static>>,
4327 > for ListAgentSkillsRequestOwnedView {
4328 fn from(
4329 inner: ::buffa::OwnedView<ListAgentSkillsRequestView<'static>>,
4330 ) -> Self {
4331 ListAgentSkillsRequestOwnedView(inner)
4332 }
4333 }
4334 impl ::core::convert::From<ListAgentSkillsRequestOwnedView>
4335 for ::buffa::OwnedView<ListAgentSkillsRequestView<'static>> {
4336 fn from(wrapper: ListAgentSkillsRequestOwnedView) -> Self {
4337 wrapper.0
4338 }
4339 }
4340 impl ::core::convert::AsRef<
4341 ::buffa::OwnedView<ListAgentSkillsRequestView<'static>>,
4342 > for ListAgentSkillsRequestOwnedView {
4343 fn as_ref(
4344 &self,
4345 ) -> &::buffa::OwnedView<ListAgentSkillsRequestView<'static>> {
4346 &self.0
4347 }
4348 }
4349 impl ::buffa::HasMessageView for super::super::ListAgentSkillsRequest {
4350 type View<'a> = ListAgentSkillsRequestView<'a>;
4351 type ViewHandle = ListAgentSkillsRequestOwnedView;
4352 }
4353 impl ::serde::Serialize for ListAgentSkillsRequestOwnedView {
4354 fn serialize<__S: ::serde::Serializer>(
4355 &self,
4356 __s: __S,
4357 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4358 ::serde::Serialize::serialize(&self.0, __s)
4359 }
4360 }
4361 #[derive(Clone, Debug, Default)]
4363 pub struct ListAgentSkillsResponseView<'a> {
4364 pub agent_skills: ::buffa::RepeatedView<
4368 'a,
4369 super::super::__buffa::view::AgentSkillView<'a>,
4370 >,
4371 pub next_page_token: ::core::option::Option<&'a str>,
4378 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4379 }
4380 impl<'a> ListAgentSkillsResponseView<'a> {
4381 #[doc(hidden)]
4389 pub fn _decode_depth(
4390 buf: &'a [u8],
4391 depth: u32,
4392 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4393 let mut view = Self::default();
4394 view._merge_into_view(buf, depth)?;
4395 ::core::result::Result::Ok(view)
4396 }
4397 #[doc(hidden)]
4405 pub fn _merge_into_view(
4406 &mut self,
4407 buf: &'a [u8],
4408 depth: u32,
4409 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4410 let _ = depth;
4411 #[allow(unused_variables)]
4412 let view = self;
4413 let mut cur: &'a [u8] = buf;
4414 while !cur.is_empty() {
4415 let before_tag = cur;
4416 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
4417 match tag.field_number() {
4418 2u32 => {
4419 if tag.wire_type()
4420 != ::buffa::encoding::WireType::LengthDelimited
4421 {
4422 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4423 field_number: 2u32,
4424 expected: 2u8,
4425 actual: tag.wire_type() as u8,
4426 });
4427 }
4428 view.next_page_token = Some(
4429 ::buffa::types::borrow_str(&mut cur)?,
4430 );
4431 }
4432 1u32 => {
4433 if tag.wire_type()
4434 != ::buffa::encoding::WireType::LengthDelimited
4435 {
4436 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4437 field_number: 1u32,
4438 expected: 2u8,
4439 actual: tag.wire_type() as u8,
4440 });
4441 }
4442 if depth == 0 {
4443 return Err(::buffa::DecodeError::RecursionLimitExceeded);
4444 }
4445 let sub = ::buffa::types::borrow_bytes(&mut cur)?;
4446 view.agent_skills
4447 .push(
4448 super::super::__buffa::view::AgentSkillView::_decode_depth(
4449 sub,
4450 depth - 1,
4451 )?,
4452 );
4453 }
4454 _ => {
4455 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4456 let span_len = before_tag.len() - cur.len();
4457 view.__buffa_unknown_fields
4458 .push_raw(&before_tag[..span_len]);
4459 }
4460 }
4461 }
4462 ::core::result::Result::Ok(())
4463 }
4464 }
4465 impl<'a> ::buffa::MessageView<'a> for ListAgentSkillsResponseView<'a> {
4466 type Owned = super::super::ListAgentSkillsResponse;
4467 fn decode_view(
4468 buf: &'a [u8],
4469 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4470 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
4471 }
4472 fn decode_view_with_limit(
4473 buf: &'a [u8],
4474 depth: u32,
4475 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4476 Self::_decode_depth(buf, depth)
4477 }
4478 fn to_owned_message(&self) -> super::super::ListAgentSkillsResponse {
4479 self.to_owned_from_source(None)
4480 }
4481 #[allow(clippy::useless_conversion, clippy::needless_update)]
4482 fn to_owned_from_source(
4483 &self,
4484 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4485 ) -> super::super::ListAgentSkillsResponse {
4486 #[allow(unused_imports)]
4487 use ::buffa::alloc::string::ToString as _;
4488 let _ = __buffa_src;
4489 super::super::ListAgentSkillsResponse {
4490 agent_skills: self
4491 .agent_skills
4492 .iter()
4493 .map(|v| v.to_owned_from_source(__buffa_src))
4494 .collect(),
4495 next_page_token: self.next_page_token.map(|s| s.to_string()),
4496 __buffa_unknown_fields: self
4497 .__buffa_unknown_fields
4498 .to_owned()
4499 .unwrap_or_default()
4500 .into(),
4501 ..::core::default::Default::default()
4502 }
4503 }
4504 }
4505 impl<'a> ::buffa::ViewEncode<'a> for ListAgentSkillsResponseView<'a> {
4506 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4507 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
4508 #[allow(unused_imports)]
4509 use ::buffa::Enumeration as _;
4510 let mut size = 0u32;
4511 for v in &self.agent_skills {
4512 let __slot = __cache.reserve();
4513 let inner_size = v.compute_size(__cache);
4514 __cache.set(__slot, inner_size);
4515 size
4516 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
4517 + inner_size;
4518 }
4519 if let Some(ref v) = self.next_page_token {
4520 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4521 }
4522 size += self.__buffa_unknown_fields.encoded_len() as u32;
4523 size
4524 }
4525 #[allow(clippy::needless_borrow)]
4526 fn write_to(
4527 &self,
4528 __cache: &mut ::buffa::SizeCache,
4529 buf: &mut impl ::buffa::bytes::BufMut,
4530 ) {
4531 #[allow(unused_imports)]
4532 use ::buffa::Enumeration as _;
4533 for v in &self.agent_skills {
4534 ::buffa::encoding::Tag::new(
4535 1u32,
4536 ::buffa::encoding::WireType::LengthDelimited,
4537 )
4538 .encode(buf);
4539 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
4540 v.write_to(__cache, buf);
4541 }
4542 if let Some(ref v) = self.next_page_token {
4543 ::buffa::encoding::Tag::new(
4544 2u32,
4545 ::buffa::encoding::WireType::LengthDelimited,
4546 )
4547 .encode(buf);
4548 ::buffa::types::encode_string(v, buf);
4549 }
4550 self.__buffa_unknown_fields.write_to(buf);
4551 }
4552 }
4553 impl<'__a> ::serde::Serialize for ListAgentSkillsResponseView<'__a> {
4565 fn serialize<__S: ::serde::Serializer>(
4566 &self,
4567 __s: __S,
4568 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4569 use ::serde::ser::SerializeMap as _;
4570 let mut __map = __s.serialize_map(::core::option::Option::None)?;
4571 if !self.agent_skills.is_empty() {
4572 __map.serialize_entry("agent_skills", &*self.agent_skills)?;
4573 }
4574 if let ::core::option::Option::Some(__v) = self.next_page_token {
4575 __map.serialize_entry("next_page_token", __v)?;
4576 }
4577 __map.end()
4578 }
4579 }
4580 impl<'a> ::buffa::MessageName for ListAgentSkillsResponseView<'a> {
4581 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
4582 const NAME: &'static str = "ListAgentSkillsResponse";
4583 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.ListAgentSkillsResponse";
4584 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.ListAgentSkillsResponse";
4585 }
4586 impl<'v> ::buffa::DefaultViewInstance for ListAgentSkillsResponseView<'v> {
4587 fn default_view_instance<'a>() -> &'a Self
4588 where
4589 Self: 'a,
4590 {
4591 static VALUE: ::buffa::__private::OnceBox<
4592 ListAgentSkillsResponseView<'static>,
4593 > = ::buffa::__private::OnceBox::new();
4594 VALUE
4595 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
4596 <ListAgentSkillsResponseView<'static>>::default(),
4597 ))
4598 }
4599 }
4600 impl ::buffa::ViewReborrow for ListAgentSkillsResponseView<'static> {
4601 type Reborrowed<'b> = ListAgentSkillsResponseView<'b>;
4602 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
4603 this
4604 }
4605 }
4606 #[derive(Clone, Debug)]
4612 pub struct ListAgentSkillsResponseOwnedView(
4613 ::buffa::OwnedView<ListAgentSkillsResponseView<'static>>,
4614 );
4615 impl ListAgentSkillsResponseOwnedView {
4616 pub fn decode(
4626 bytes: ::buffa::bytes::Bytes,
4627 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4628 ::core::result::Result::Ok(
4629 ListAgentSkillsResponseOwnedView(::buffa::OwnedView::decode(bytes)?),
4630 )
4631 }
4632 pub fn decode_with_options(
4640 bytes: ::buffa::bytes::Bytes,
4641 opts: &::buffa::DecodeOptions,
4642 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4643 ::core::result::Result::Ok(
4644 ListAgentSkillsResponseOwnedView(
4645 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4646 ),
4647 )
4648 }
4649 pub fn from_owned(
4656 msg: &super::super::ListAgentSkillsResponse,
4657 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4658 ::core::result::Result::Ok(
4659 ListAgentSkillsResponseOwnedView(
4660 ::buffa::OwnedView::from_owned(msg)?,
4661 ),
4662 )
4663 }
4664 #[must_use]
4666 pub fn view(&self) -> &ListAgentSkillsResponseView<'_> {
4667 self.0.reborrow()
4668 }
4669 #[must_use]
4671 pub fn to_owned_message(&self) -> super::super::ListAgentSkillsResponse {
4672 self.0.to_owned_message()
4673 }
4674 #[must_use]
4676 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4677 self.0.bytes()
4678 }
4679 #[must_use]
4681 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4682 self.0.into_bytes()
4683 }
4684 #[must_use]
4688 pub fn agent_skills(
4689 &self,
4690 ) -> &::buffa::RepeatedView<
4691 '_,
4692 super::super::__buffa::view::AgentSkillView<'_>,
4693 > {
4694 &self.0.reborrow().agent_skills
4695 }
4696 #[must_use]
4703 pub fn next_page_token(&self) -> ::core::option::Option<&'_ str> {
4704 self.0.reborrow().next_page_token
4705 }
4706 }
4707 impl ::core::convert::From<
4708 ::buffa::OwnedView<ListAgentSkillsResponseView<'static>>,
4709 > for ListAgentSkillsResponseOwnedView {
4710 fn from(
4711 inner: ::buffa::OwnedView<ListAgentSkillsResponseView<'static>>,
4712 ) -> Self {
4713 ListAgentSkillsResponseOwnedView(inner)
4714 }
4715 }
4716 impl ::core::convert::From<ListAgentSkillsResponseOwnedView>
4717 for ::buffa::OwnedView<ListAgentSkillsResponseView<'static>> {
4718 fn from(wrapper: ListAgentSkillsResponseOwnedView) -> Self {
4719 wrapper.0
4720 }
4721 }
4722 impl ::core::convert::AsRef<
4723 ::buffa::OwnedView<ListAgentSkillsResponseView<'static>>,
4724 > for ListAgentSkillsResponseOwnedView {
4725 fn as_ref(
4726 &self,
4727 ) -> &::buffa::OwnedView<ListAgentSkillsResponseView<'static>> {
4728 &self.0
4729 }
4730 }
4731 impl ::buffa::HasMessageView for super::super::ListAgentSkillsResponse {
4732 type View<'a> = ListAgentSkillsResponseView<'a>;
4733 type ViewHandle = ListAgentSkillsResponseOwnedView;
4734 }
4735 impl ::serde::Serialize for ListAgentSkillsResponseOwnedView {
4736 fn serialize<__S: ::serde::Serializer>(
4737 &self,
4738 __s: __S,
4739 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4740 ::serde::Serialize::serialize(&self.0, __s)
4741 }
4742 }
4743 #[derive(Clone, Debug, Default)]
4745 pub struct CreateAgentSkillRequestView<'a> {
4746 pub catalog_name: &'a str,
4750 pub schema_name: &'a str,
4754 pub name: &'a str,
4758 pub agent_skill_type: ::buffa::EnumValue<super::super::AgentSkillType>,
4762 pub storage_location: ::core::option::Option<&'a str>,
4768 pub description: ::core::option::Option<&'a str>,
4772 pub license: ::core::option::Option<&'a str>,
4776 pub allowed_tools: ::buffa::RepeatedView<'a, &'a str>,
4780 pub metadata: ::buffa::MapView<'a, &'a str, &'a str>,
4784 pub comment: ::core::option::Option<&'a str>,
4788 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4789 }
4790 impl<'a> CreateAgentSkillRequestView<'a> {
4791 #[doc(hidden)]
4799 pub fn _decode_depth(
4800 buf: &'a [u8],
4801 depth: u32,
4802 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4803 let mut view = Self::default();
4804 view._merge_into_view(buf, depth)?;
4805 ::core::result::Result::Ok(view)
4806 }
4807 #[doc(hidden)]
4815 pub fn _merge_into_view(
4816 &mut self,
4817 buf: &'a [u8],
4818 depth: u32,
4819 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4820 let _ = depth;
4821 #[allow(unused_variables)]
4822 let view = self;
4823 let mut cur: &'a [u8] = buf;
4824 while !cur.is_empty() {
4825 let before_tag = cur;
4826 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
4827 match tag.field_number() {
4828 1u32 => {
4829 if tag.wire_type()
4830 != ::buffa::encoding::WireType::LengthDelimited
4831 {
4832 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4833 field_number: 1u32,
4834 expected: 2u8,
4835 actual: tag.wire_type() as u8,
4836 });
4837 }
4838 view.catalog_name = ::buffa::types::borrow_str(&mut cur)?;
4839 }
4840 2u32 => {
4841 if tag.wire_type()
4842 != ::buffa::encoding::WireType::LengthDelimited
4843 {
4844 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4845 field_number: 2u32,
4846 expected: 2u8,
4847 actual: tag.wire_type() as u8,
4848 });
4849 }
4850 view.schema_name = ::buffa::types::borrow_str(&mut cur)?;
4851 }
4852 3u32 => {
4853 if tag.wire_type()
4854 != ::buffa::encoding::WireType::LengthDelimited
4855 {
4856 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4857 field_number: 3u32,
4858 expected: 2u8,
4859 actual: tag.wire_type() as u8,
4860 });
4861 }
4862 view.name = ::buffa::types::borrow_str(&mut cur)?;
4863 }
4864 4u32 => {
4865 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4866 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4867 field_number: 4u32,
4868 expected: 0u8,
4869 actual: tag.wire_type() as u8,
4870 });
4871 }
4872 view.agent_skill_type = ::buffa::EnumValue::from(
4873 ::buffa::types::decode_int32(&mut cur)?,
4874 );
4875 }
4876 5u32 => {
4877 if tag.wire_type()
4878 != ::buffa::encoding::WireType::LengthDelimited
4879 {
4880 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4881 field_number: 5u32,
4882 expected: 2u8,
4883 actual: tag.wire_type() as u8,
4884 });
4885 }
4886 view.storage_location = Some(
4887 ::buffa::types::borrow_str(&mut cur)?,
4888 );
4889 }
4890 6u32 => {
4891 if tag.wire_type()
4892 != ::buffa::encoding::WireType::LengthDelimited
4893 {
4894 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4895 field_number: 6u32,
4896 expected: 2u8,
4897 actual: tag.wire_type() as u8,
4898 });
4899 }
4900 view.description = Some(
4901 ::buffa::types::borrow_str(&mut cur)?,
4902 );
4903 }
4904 7u32 => {
4905 if tag.wire_type()
4906 != ::buffa::encoding::WireType::LengthDelimited
4907 {
4908 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4909 field_number: 7u32,
4910 expected: 2u8,
4911 actual: tag.wire_type() as u8,
4912 });
4913 }
4914 view.license = Some(::buffa::types::borrow_str(&mut cur)?);
4915 }
4916 10u32 => {
4917 if tag.wire_type()
4918 != ::buffa::encoding::WireType::LengthDelimited
4919 {
4920 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4921 field_number: 10u32,
4922 expected: 2u8,
4923 actual: tag.wire_type() as u8,
4924 });
4925 }
4926 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
4927 }
4928 8u32 => {
4929 if tag.wire_type()
4930 != ::buffa::encoding::WireType::LengthDelimited
4931 {
4932 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4933 field_number: 8u32,
4934 expected: 2u8,
4935 actual: tag.wire_type() as u8,
4936 });
4937 }
4938 view.allowed_tools
4939 .push(::buffa::types::borrow_str(&mut cur)?);
4940 }
4941 9u32 => {
4942 if tag.wire_type()
4943 != ::buffa::encoding::WireType::LengthDelimited
4944 {
4945 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4946 field_number: 9u32,
4947 expected: 2u8,
4948 actual: tag.wire_type() as u8,
4949 });
4950 }
4951 let entry_bytes = ::buffa::types::borrow_bytes(&mut cur)?;
4952 let mut entry_cur: &'a [u8] = entry_bytes;
4953 let mut key = "";
4954 let mut val = "";
4955 while !entry_cur.is_empty() {
4956 let entry_tag = ::buffa::encoding::Tag::decode(
4957 &mut entry_cur,
4958 )?;
4959 match entry_tag.field_number() {
4960 1 => {
4961 if entry_tag.wire_type()
4962 != ::buffa::encoding::WireType::LengthDelimited
4963 {
4964 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4965 field_number: entry_tag.field_number(),
4966 expected: 2u8,
4967 actual: entry_tag.wire_type() as u8,
4968 });
4969 }
4970 key = ::buffa::types::borrow_str(&mut entry_cur)?;
4971 }
4972 2 => {
4973 if entry_tag.wire_type()
4974 != ::buffa::encoding::WireType::LengthDelimited
4975 {
4976 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4977 field_number: entry_tag.field_number(),
4978 expected: 2u8,
4979 actual: entry_tag.wire_type() as u8,
4980 });
4981 }
4982 val = ::buffa::types::borrow_str(&mut entry_cur)?;
4983 }
4984 _ => {
4985 ::buffa::encoding::skip_field_depth(
4986 entry_tag,
4987 &mut entry_cur,
4988 depth,
4989 )?;
4990 }
4991 }
4992 }
4993 view.metadata.push(key, val);
4994 }
4995 _ => {
4996 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4997 let span_len = before_tag.len() - cur.len();
4998 view.__buffa_unknown_fields
4999 .push_raw(&before_tag[..span_len]);
5000 }
5001 }
5002 }
5003 ::core::result::Result::Ok(())
5004 }
5005 }
5006 impl<'a> ::buffa::MessageView<'a> for CreateAgentSkillRequestView<'a> {
5007 type Owned = super::super::CreateAgentSkillRequest;
5008 fn decode_view(
5009 buf: &'a [u8],
5010 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5011 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
5012 }
5013 fn decode_view_with_limit(
5014 buf: &'a [u8],
5015 depth: u32,
5016 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5017 Self::_decode_depth(buf, depth)
5018 }
5019 fn to_owned_message(&self) -> super::super::CreateAgentSkillRequest {
5020 self.to_owned_from_source(None)
5021 }
5022 #[allow(clippy::useless_conversion, clippy::needless_update)]
5023 fn to_owned_from_source(
5024 &self,
5025 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
5026 ) -> super::super::CreateAgentSkillRequest {
5027 #[allow(unused_imports)]
5028 use ::buffa::alloc::string::ToString as _;
5029 let _ = __buffa_src;
5030 super::super::CreateAgentSkillRequest {
5031 catalog_name: self.catalog_name.to_string(),
5032 schema_name: self.schema_name.to_string(),
5033 name: self.name.to_string(),
5034 agent_skill_type: self.agent_skill_type,
5035 storage_location: self.storage_location.map(|s| s.to_string()),
5036 description: self.description.map(|s| s.to_string()),
5037 license: self.license.map(|s| s.to_string()),
5038 allowed_tools: self
5039 .allowed_tools
5040 .iter()
5041 .map(|s| s.to_string())
5042 .collect(),
5043 metadata: self
5044 .metadata
5045 .iter()
5046 .map(|(k, v)| (k.to_string(), v.to_string()))
5047 .collect(),
5048 comment: self.comment.map(|s| s.to_string()),
5049 __buffa_unknown_fields: self
5050 .__buffa_unknown_fields
5051 .to_owned()
5052 .unwrap_or_default()
5053 .into(),
5054 ..::core::default::Default::default()
5055 }
5056 }
5057 }
5058 impl<'a> ::buffa::ViewEncode<'a> for CreateAgentSkillRequestView<'a> {
5059 #[allow(clippy::needless_borrow, clippy::let_and_return)]
5060 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5061 #[allow(unused_imports)]
5062 use ::buffa::Enumeration as _;
5063 let mut size = 0u32;
5064 if !self.catalog_name.is_empty() {
5065 size
5066 += 1u32
5067 + ::buffa::types::string_encoded_len(&self.catalog_name)
5068 as u32;
5069 }
5070 if !self.schema_name.is_empty() {
5071 size
5072 += 1u32
5073 + ::buffa::types::string_encoded_len(&self.schema_name)
5074 as u32;
5075 }
5076 if !self.name.is_empty() {
5077 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
5078 }
5079 {
5080 let val = self.agent_skill_type.to_i32();
5081 if val != 0 {
5082 size += 1u32 + ::buffa::types::int32_encoded_len(val) as u32;
5083 }
5084 }
5085 if let Some(ref v) = self.storage_location {
5086 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5087 }
5088 if let Some(ref v) = self.description {
5089 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5090 }
5091 if let Some(ref v) = self.license {
5092 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5093 }
5094 for v in &self.allowed_tools {
5095 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5096 }
5097 #[allow(clippy::for_kv_map)]
5098 for (k, v) in &self.metadata {
5099 let entry_size: u32 = 1u32
5100 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
5101 + ::buffa::types::string_encoded_len(v) as u32;
5102 size
5103 += 1u32 + ::buffa::encoding::varint_len(entry_size as u64) as u32
5104 + entry_size;
5105 }
5106 if let Some(ref v) = self.comment {
5107 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
5108 }
5109 size += self.__buffa_unknown_fields.encoded_len() as u32;
5110 size
5111 }
5112 #[allow(clippy::needless_borrow)]
5113 fn write_to(
5114 &self,
5115 _cache: &mut ::buffa::SizeCache,
5116 buf: &mut impl ::buffa::bytes::BufMut,
5117 ) {
5118 #[allow(unused_imports)]
5119 use ::buffa::Enumeration as _;
5120 if !self.catalog_name.is_empty() {
5121 ::buffa::encoding::Tag::new(
5122 1u32,
5123 ::buffa::encoding::WireType::LengthDelimited,
5124 )
5125 .encode(buf);
5126 ::buffa::types::encode_string(&self.catalog_name, buf);
5127 }
5128 if !self.schema_name.is_empty() {
5129 ::buffa::encoding::Tag::new(
5130 2u32,
5131 ::buffa::encoding::WireType::LengthDelimited,
5132 )
5133 .encode(buf);
5134 ::buffa::types::encode_string(&self.schema_name, buf);
5135 }
5136 if !self.name.is_empty() {
5137 ::buffa::encoding::Tag::new(
5138 3u32,
5139 ::buffa::encoding::WireType::LengthDelimited,
5140 )
5141 .encode(buf);
5142 ::buffa::types::encode_string(&self.name, buf);
5143 }
5144 {
5145 let val = self.agent_skill_type.to_i32();
5146 if val != 0 {
5147 ::buffa::encoding::Tag::new(
5148 4u32,
5149 ::buffa::encoding::WireType::Varint,
5150 )
5151 .encode(buf);
5152 ::buffa::types::encode_int32(val, buf);
5153 }
5154 }
5155 if let Some(ref v) = self.storage_location {
5156 ::buffa::encoding::Tag::new(
5157 5u32,
5158 ::buffa::encoding::WireType::LengthDelimited,
5159 )
5160 .encode(buf);
5161 ::buffa::types::encode_string(v, buf);
5162 }
5163 if let Some(ref v) = self.description {
5164 ::buffa::encoding::Tag::new(
5165 6u32,
5166 ::buffa::encoding::WireType::LengthDelimited,
5167 )
5168 .encode(buf);
5169 ::buffa::types::encode_string(v, buf);
5170 }
5171 if let Some(ref v) = self.license {
5172 ::buffa::encoding::Tag::new(
5173 7u32,
5174 ::buffa::encoding::WireType::LengthDelimited,
5175 )
5176 .encode(buf);
5177 ::buffa::types::encode_string(v, buf);
5178 }
5179 for v in &self.allowed_tools {
5180 ::buffa::encoding::Tag::new(
5181 8u32,
5182 ::buffa::encoding::WireType::LengthDelimited,
5183 )
5184 .encode(buf);
5185 ::buffa::types::encode_string(v, buf);
5186 }
5187 for (k, v) in &self.metadata {
5188 let entry_size: u32 = 1u32
5189 + ::buffa::types::string_encoded_len(k) as u32 + 1u32
5190 + ::buffa::types::string_encoded_len(v) as u32;
5191 ::buffa::encoding::Tag::new(
5192 9u32,
5193 ::buffa::encoding::WireType::LengthDelimited,
5194 )
5195 .encode(buf);
5196 ::buffa::encoding::encode_varint(entry_size as u64, buf);
5197 ::buffa::encoding::Tag::new(
5198 1u32,
5199 ::buffa::encoding::WireType::LengthDelimited,
5200 )
5201 .encode(buf);
5202 ::buffa::types::encode_string(k, buf);
5203 ::buffa::encoding::Tag::new(
5204 2u32,
5205 ::buffa::encoding::WireType::LengthDelimited,
5206 )
5207 .encode(buf);
5208 ::buffa::types::encode_string(v, buf);
5209 }
5210 if let Some(ref v) = self.comment {
5211 ::buffa::encoding::Tag::new(
5212 10u32,
5213 ::buffa::encoding::WireType::LengthDelimited,
5214 )
5215 .encode(buf);
5216 ::buffa::types::encode_string(v, buf);
5217 }
5218 self.__buffa_unknown_fields.write_to(buf);
5219 }
5220 }
5221 impl<'__a> ::serde::Serialize for CreateAgentSkillRequestView<'__a> {
5233 fn serialize<__S: ::serde::Serializer>(
5234 &self,
5235 __s: __S,
5236 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5237 use ::serde::ser::SerializeMap as _;
5238 let mut __map = __s.serialize_map(::core::option::Option::None)?;
5239 if !::buffa::json_helpers::skip_if::is_empty_str(self.catalog_name) {
5240 __map.serialize_entry("catalog_name", self.catalog_name)?;
5241 }
5242 if !::buffa::json_helpers::skip_if::is_empty_str(self.schema_name) {
5243 __map.serialize_entry("schema_name", self.schema_name)?;
5244 }
5245 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
5246 __map.serialize_entry("name", self.name)?;
5247 }
5248 if !::buffa::json_helpers::skip_if::is_default_enum_value(
5249 &self.agent_skill_type,
5250 ) {
5251 __map.serialize_entry("agent_skill_type", &self.agent_skill_type)?;
5252 }
5253 if let ::core::option::Option::Some(__v) = self.storage_location {
5254 __map.serialize_entry("storage_location", __v)?;
5255 }
5256 if let ::core::option::Option::Some(__v) = self.description {
5257 __map.serialize_entry("description", __v)?;
5258 }
5259 if let ::core::option::Option::Some(__v) = self.license {
5260 __map.serialize_entry("license", __v)?;
5261 }
5262 if !self.allowed_tools.is_empty() {
5263 __map.serialize_entry("allowed_tools", &*self.allowed_tools)?;
5264 }
5265 if !self.metadata.is_empty() {
5266 struct _WM<'__a, '__x>(
5267 &'__x ::buffa::MapView<'__x, &'__a str, &'__a str>,
5268 );
5269 impl<'__a> ::serde::Serialize for _WM<'__a, '_> {
5270 fn serialize<__S: ::serde::Serializer>(
5271 &self,
5272 __s: __S,
5273 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5274 use ::serde::ser::SerializeMap as _;
5275 let mut __m = __s
5276 .serialize_map(::core::option::Option::Some(self.0.len()))?;
5277 for (k, v) in self.0.iter_unique() {
5278 __m.serialize_entry(k, v)?;
5279 }
5280 __m.end()
5281 }
5282 }
5283 __map.serialize_entry("metadata", &_WM(&self.metadata))?;
5284 }
5285 if let ::core::option::Option::Some(__v) = self.comment {
5286 __map.serialize_entry("comment", __v)?;
5287 }
5288 __map.end()
5289 }
5290 }
5291 impl<'a> ::buffa::MessageName for CreateAgentSkillRequestView<'a> {
5292 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
5293 const NAME: &'static str = "CreateAgentSkillRequest";
5294 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.CreateAgentSkillRequest";
5295 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.CreateAgentSkillRequest";
5296 }
5297 impl<'v> ::buffa::DefaultViewInstance for CreateAgentSkillRequestView<'v> {
5298 fn default_view_instance<'a>() -> &'a Self
5299 where
5300 Self: 'a,
5301 {
5302 static VALUE: ::buffa::__private::OnceBox<
5303 CreateAgentSkillRequestView<'static>,
5304 > = ::buffa::__private::OnceBox::new();
5305 VALUE
5306 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
5307 <CreateAgentSkillRequestView<'static>>::default(),
5308 ))
5309 }
5310 }
5311 impl ::buffa::ViewReborrow for CreateAgentSkillRequestView<'static> {
5312 type Reborrowed<'b> = CreateAgentSkillRequestView<'b>;
5313 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
5314 this
5315 }
5316 }
5317 #[derive(Clone, Debug)]
5323 pub struct CreateAgentSkillRequestOwnedView(
5324 ::buffa::OwnedView<CreateAgentSkillRequestView<'static>>,
5325 );
5326 impl CreateAgentSkillRequestOwnedView {
5327 pub fn decode(
5337 bytes: ::buffa::bytes::Bytes,
5338 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5339 ::core::result::Result::Ok(
5340 CreateAgentSkillRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
5341 )
5342 }
5343 pub fn decode_with_options(
5351 bytes: ::buffa::bytes::Bytes,
5352 opts: &::buffa::DecodeOptions,
5353 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5354 ::core::result::Result::Ok(
5355 CreateAgentSkillRequestOwnedView(
5356 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5357 ),
5358 )
5359 }
5360 pub fn from_owned(
5367 msg: &super::super::CreateAgentSkillRequest,
5368 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5369 ::core::result::Result::Ok(
5370 CreateAgentSkillRequestOwnedView(
5371 ::buffa::OwnedView::from_owned(msg)?,
5372 ),
5373 )
5374 }
5375 #[must_use]
5377 pub fn view(&self) -> &CreateAgentSkillRequestView<'_> {
5378 self.0.reborrow()
5379 }
5380 #[must_use]
5382 pub fn to_owned_message(&self) -> super::super::CreateAgentSkillRequest {
5383 self.0.to_owned_message()
5384 }
5385 #[must_use]
5387 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5388 self.0.bytes()
5389 }
5390 #[must_use]
5392 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5393 self.0.into_bytes()
5394 }
5395 #[must_use]
5399 pub fn catalog_name(&self) -> &'_ str {
5400 self.0.reborrow().catalog_name
5401 }
5402 #[must_use]
5406 pub fn schema_name(&self) -> &'_ str {
5407 self.0.reborrow().schema_name
5408 }
5409 #[must_use]
5413 pub fn name(&self) -> &'_ str {
5414 self.0.reborrow().name
5415 }
5416 #[must_use]
5420 pub fn agent_skill_type(
5421 &self,
5422 ) -> ::buffa::EnumValue<super::super::AgentSkillType> {
5423 self.0.reborrow().agent_skill_type
5424 }
5425 #[must_use]
5431 pub fn storage_location(&self) -> ::core::option::Option<&'_ str> {
5432 self.0.reborrow().storage_location
5433 }
5434 #[must_use]
5438 pub fn description(&self) -> ::core::option::Option<&'_ str> {
5439 self.0.reborrow().description
5440 }
5441 #[must_use]
5445 pub fn license(&self) -> ::core::option::Option<&'_ str> {
5446 self.0.reborrow().license
5447 }
5448 #[must_use]
5452 pub fn allowed_tools(&self) -> &::buffa::RepeatedView<'_, &'_ str> {
5453 &self.0.reborrow().allowed_tools
5454 }
5455 #[must_use]
5459 pub fn metadata(&self) -> &::buffa::MapView<'_, &'_ str, &'_ str> {
5460 &self.0.reborrow().metadata
5461 }
5462 #[must_use]
5466 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
5467 self.0.reborrow().comment
5468 }
5469 }
5470 impl ::core::convert::From<
5471 ::buffa::OwnedView<CreateAgentSkillRequestView<'static>>,
5472 > for CreateAgentSkillRequestOwnedView {
5473 fn from(
5474 inner: ::buffa::OwnedView<CreateAgentSkillRequestView<'static>>,
5475 ) -> Self {
5476 CreateAgentSkillRequestOwnedView(inner)
5477 }
5478 }
5479 impl ::core::convert::From<CreateAgentSkillRequestOwnedView>
5480 for ::buffa::OwnedView<CreateAgentSkillRequestView<'static>> {
5481 fn from(wrapper: CreateAgentSkillRequestOwnedView) -> Self {
5482 wrapper.0
5483 }
5484 }
5485 impl ::core::convert::AsRef<
5486 ::buffa::OwnedView<CreateAgentSkillRequestView<'static>>,
5487 > for CreateAgentSkillRequestOwnedView {
5488 fn as_ref(
5489 &self,
5490 ) -> &::buffa::OwnedView<CreateAgentSkillRequestView<'static>> {
5491 &self.0
5492 }
5493 }
5494 impl ::buffa::HasMessageView for super::super::CreateAgentSkillRequest {
5495 type View<'a> = CreateAgentSkillRequestView<'a>;
5496 type ViewHandle = CreateAgentSkillRequestOwnedView;
5497 }
5498 impl ::serde::Serialize for CreateAgentSkillRequestOwnedView {
5499 fn serialize<__S: ::serde::Serializer>(
5500 &self,
5501 __s: __S,
5502 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5503 ::serde::Serialize::serialize(&self.0, __s)
5504 }
5505 }
5506 #[derive(Clone, Debug, Default)]
5507 pub struct GetAgentSkillRequestView<'a> {
5508 pub name: &'a str,
5512 pub include_browse: ::core::option::Option<bool>,
5517 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
5518 }
5519 impl<'a> GetAgentSkillRequestView<'a> {
5520 #[doc(hidden)]
5528 pub fn _decode_depth(
5529 buf: &'a [u8],
5530 depth: u32,
5531 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5532 let mut view = Self::default();
5533 view._merge_into_view(buf, depth)?;
5534 ::core::result::Result::Ok(view)
5535 }
5536 #[doc(hidden)]
5544 pub fn _merge_into_view(
5545 &mut self,
5546 buf: &'a [u8],
5547 depth: u32,
5548 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5549 let _ = depth;
5550 #[allow(unused_variables)]
5551 let view = self;
5552 let mut cur: &'a [u8] = buf;
5553 while !cur.is_empty() {
5554 let before_tag = cur;
5555 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
5556 match tag.field_number() {
5557 1u32 => {
5558 if tag.wire_type()
5559 != ::buffa::encoding::WireType::LengthDelimited
5560 {
5561 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5562 field_number: 1u32,
5563 expected: 2u8,
5564 actual: tag.wire_type() as u8,
5565 });
5566 }
5567 view.name = ::buffa::types::borrow_str(&mut cur)?;
5568 }
5569 1005u32 => {
5570 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
5571 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5572 field_number: 1005u32,
5573 expected: 0u8,
5574 actual: tag.wire_type() as u8,
5575 });
5576 }
5577 view.include_browse = Some(
5578 ::buffa::types::decode_bool(&mut cur)?,
5579 );
5580 }
5581 _ => {
5582 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
5583 let span_len = before_tag.len() - cur.len();
5584 view.__buffa_unknown_fields
5585 .push_raw(&before_tag[..span_len]);
5586 }
5587 }
5588 }
5589 ::core::result::Result::Ok(())
5590 }
5591 }
5592 impl<'a> ::buffa::MessageView<'a> for GetAgentSkillRequestView<'a> {
5593 type Owned = super::super::GetAgentSkillRequest;
5594 fn decode_view(
5595 buf: &'a [u8],
5596 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5597 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
5598 }
5599 fn decode_view_with_limit(
5600 buf: &'a [u8],
5601 depth: u32,
5602 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5603 Self::_decode_depth(buf, depth)
5604 }
5605 fn to_owned_message(&self) -> super::super::GetAgentSkillRequest {
5606 self.to_owned_from_source(None)
5607 }
5608 #[allow(clippy::useless_conversion, clippy::needless_update)]
5609 fn to_owned_from_source(
5610 &self,
5611 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
5612 ) -> super::super::GetAgentSkillRequest {
5613 #[allow(unused_imports)]
5614 use ::buffa::alloc::string::ToString as _;
5615 let _ = __buffa_src;
5616 super::super::GetAgentSkillRequest {
5617 name: self.name.to_string(),
5618 include_browse: self.include_browse,
5619 __buffa_unknown_fields: self
5620 .__buffa_unknown_fields
5621 .to_owned()
5622 .unwrap_or_default()
5623 .into(),
5624 ..::core::default::Default::default()
5625 }
5626 }
5627 }
5628 impl<'a> ::buffa::ViewEncode<'a> for GetAgentSkillRequestView<'a> {
5629 #[allow(clippy::needless_borrow, clippy::let_and_return)]
5630 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5631 #[allow(unused_imports)]
5632 use ::buffa::Enumeration as _;
5633 let mut size = 0u32;
5634 if !self.name.is_empty() {
5635 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
5636 }
5637 if self.include_browse.is_some() {
5638 size += 2u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
5639 }
5640 size += self.__buffa_unknown_fields.encoded_len() as u32;
5641 size
5642 }
5643 #[allow(clippy::needless_borrow)]
5644 fn write_to(
5645 &self,
5646 _cache: &mut ::buffa::SizeCache,
5647 buf: &mut impl ::buffa::bytes::BufMut,
5648 ) {
5649 #[allow(unused_imports)]
5650 use ::buffa::Enumeration as _;
5651 if !self.name.is_empty() {
5652 ::buffa::encoding::Tag::new(
5653 1u32,
5654 ::buffa::encoding::WireType::LengthDelimited,
5655 )
5656 .encode(buf);
5657 ::buffa::types::encode_string(&self.name, buf);
5658 }
5659 if let Some(v) = self.include_browse {
5660 ::buffa::encoding::Tag::new(
5661 1005u32,
5662 ::buffa::encoding::WireType::Varint,
5663 )
5664 .encode(buf);
5665 ::buffa::types::encode_bool(v, buf);
5666 }
5667 self.__buffa_unknown_fields.write_to(buf);
5668 }
5669 }
5670 impl<'__a> ::serde::Serialize for GetAgentSkillRequestView<'__a> {
5682 fn serialize<__S: ::serde::Serializer>(
5683 &self,
5684 __s: __S,
5685 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5686 use ::serde::ser::SerializeMap as _;
5687 let mut __map = __s.serialize_map(::core::option::Option::None)?;
5688 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
5689 __map.serialize_entry("name", self.name)?;
5690 }
5691 if let ::core::option::Option::Some(__v) = self.include_browse {
5692 __map.serialize_entry("include_browse", &__v)?;
5693 }
5694 __map.end()
5695 }
5696 }
5697 impl<'a> ::buffa::MessageName for GetAgentSkillRequestView<'a> {
5698 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
5699 const NAME: &'static str = "GetAgentSkillRequest";
5700 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.GetAgentSkillRequest";
5701 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.GetAgentSkillRequest";
5702 }
5703 impl<'v> ::buffa::DefaultViewInstance for GetAgentSkillRequestView<'v> {
5704 fn default_view_instance<'a>() -> &'a Self
5705 where
5706 Self: 'a,
5707 {
5708 static VALUE: ::buffa::__private::OnceBox<
5709 GetAgentSkillRequestView<'static>,
5710 > = ::buffa::__private::OnceBox::new();
5711 VALUE
5712 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
5713 <GetAgentSkillRequestView<'static>>::default(),
5714 ))
5715 }
5716 }
5717 impl ::buffa::ViewReborrow for GetAgentSkillRequestView<'static> {
5718 type Reborrowed<'b> = GetAgentSkillRequestView<'b>;
5719 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
5720 this
5721 }
5722 }
5723 #[derive(Clone, Debug)]
5729 pub struct GetAgentSkillRequestOwnedView(
5730 ::buffa::OwnedView<GetAgentSkillRequestView<'static>>,
5731 );
5732 impl GetAgentSkillRequestOwnedView {
5733 pub fn decode(
5743 bytes: ::buffa::bytes::Bytes,
5744 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5745 ::core::result::Result::Ok(
5746 GetAgentSkillRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
5747 )
5748 }
5749 pub fn decode_with_options(
5757 bytes: ::buffa::bytes::Bytes,
5758 opts: &::buffa::DecodeOptions,
5759 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5760 ::core::result::Result::Ok(
5761 GetAgentSkillRequestOwnedView(
5762 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5763 ),
5764 )
5765 }
5766 pub fn from_owned(
5773 msg: &super::super::GetAgentSkillRequest,
5774 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5775 ::core::result::Result::Ok(
5776 GetAgentSkillRequestOwnedView(::buffa::OwnedView::from_owned(msg)?),
5777 )
5778 }
5779 #[must_use]
5781 pub fn view(&self) -> &GetAgentSkillRequestView<'_> {
5782 self.0.reborrow()
5783 }
5784 #[must_use]
5786 pub fn to_owned_message(&self) -> super::super::GetAgentSkillRequest {
5787 self.0.to_owned_message()
5788 }
5789 #[must_use]
5791 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5792 self.0.bytes()
5793 }
5794 #[must_use]
5796 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5797 self.0.into_bytes()
5798 }
5799 #[must_use]
5803 pub fn name(&self) -> &'_ str {
5804 self.0.reborrow().name
5805 }
5806 #[must_use]
5811 pub fn include_browse(&self) -> ::core::option::Option<bool> {
5812 self.0.reborrow().include_browse
5813 }
5814 }
5815 impl ::core::convert::From<::buffa::OwnedView<GetAgentSkillRequestView<'static>>>
5816 for GetAgentSkillRequestOwnedView {
5817 fn from(
5818 inner: ::buffa::OwnedView<GetAgentSkillRequestView<'static>>,
5819 ) -> Self {
5820 GetAgentSkillRequestOwnedView(inner)
5821 }
5822 }
5823 impl ::core::convert::From<GetAgentSkillRequestOwnedView>
5824 for ::buffa::OwnedView<GetAgentSkillRequestView<'static>> {
5825 fn from(wrapper: GetAgentSkillRequestOwnedView) -> Self {
5826 wrapper.0
5827 }
5828 }
5829 impl ::core::convert::AsRef<
5830 ::buffa::OwnedView<GetAgentSkillRequestView<'static>>,
5831 > for GetAgentSkillRequestOwnedView {
5832 fn as_ref(&self) -> &::buffa::OwnedView<GetAgentSkillRequestView<'static>> {
5833 &self.0
5834 }
5835 }
5836 impl ::buffa::HasMessageView for super::super::GetAgentSkillRequest {
5837 type View<'a> = GetAgentSkillRequestView<'a>;
5838 type ViewHandle = GetAgentSkillRequestOwnedView;
5839 }
5840 impl ::serde::Serialize for GetAgentSkillRequestOwnedView {
5841 fn serialize<__S: ::serde::Serializer>(
5842 &self,
5843 __s: __S,
5844 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5845 ::serde::Serialize::serialize(&self.0, __s)
5846 }
5847 }
5848 #[derive(Clone, Debug, Default)]
5849 pub struct UpdateAgentSkillRequestView<'a> {
5850 pub name: &'a str,
5854 pub new_name: ::core::option::Option<&'a str>,
5858 pub description: ::core::option::Option<&'a str>,
5862 pub allowed_tools: ::buffa::RepeatedView<'a, &'a str>,
5866 pub comment: ::core::option::Option<&'a str>,
5870 pub owner: ::core::option::Option<&'a str>,
5874 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
5875 }
5876 impl<'a> UpdateAgentSkillRequestView<'a> {
5877 #[doc(hidden)]
5885 pub fn _decode_depth(
5886 buf: &'a [u8],
5887 depth: u32,
5888 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5889 let mut view = Self::default();
5890 view._merge_into_view(buf, depth)?;
5891 ::core::result::Result::Ok(view)
5892 }
5893 #[doc(hidden)]
5901 pub fn _merge_into_view(
5902 &mut self,
5903 buf: &'a [u8],
5904 depth: u32,
5905 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5906 let _ = depth;
5907 #[allow(unused_variables)]
5908 let view = self;
5909 let mut cur: &'a [u8] = buf;
5910 while !cur.is_empty() {
5911 let before_tag = cur;
5912 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
5913 match tag.field_number() {
5914 1u32 => {
5915 if tag.wire_type()
5916 != ::buffa::encoding::WireType::LengthDelimited
5917 {
5918 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5919 field_number: 1u32,
5920 expected: 2u8,
5921 actual: tag.wire_type() as u8,
5922 });
5923 }
5924 view.name = ::buffa::types::borrow_str(&mut cur)?;
5925 }
5926 2u32 => {
5927 if tag.wire_type()
5928 != ::buffa::encoding::WireType::LengthDelimited
5929 {
5930 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5931 field_number: 2u32,
5932 expected: 2u8,
5933 actual: tag.wire_type() as u8,
5934 });
5935 }
5936 view.new_name = Some(::buffa::types::borrow_str(&mut cur)?);
5937 }
5938 3u32 => {
5939 if tag.wire_type()
5940 != ::buffa::encoding::WireType::LengthDelimited
5941 {
5942 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5943 field_number: 3u32,
5944 expected: 2u8,
5945 actual: tag.wire_type() as u8,
5946 });
5947 }
5948 view.description = Some(
5949 ::buffa::types::borrow_str(&mut cur)?,
5950 );
5951 }
5952 5u32 => {
5953 if tag.wire_type()
5954 != ::buffa::encoding::WireType::LengthDelimited
5955 {
5956 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5957 field_number: 5u32,
5958 expected: 2u8,
5959 actual: tag.wire_type() as u8,
5960 });
5961 }
5962 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
5963 }
5964 6u32 => {
5965 if tag.wire_type()
5966 != ::buffa::encoding::WireType::LengthDelimited
5967 {
5968 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5969 field_number: 6u32,
5970 expected: 2u8,
5971 actual: tag.wire_type() as u8,
5972 });
5973 }
5974 view.owner = Some(::buffa::types::borrow_str(&mut cur)?);
5975 }
5976 4u32 => {
5977 if tag.wire_type()
5978 != ::buffa::encoding::WireType::LengthDelimited
5979 {
5980 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5981 field_number: 4u32,
5982 expected: 2u8,
5983 actual: tag.wire_type() as u8,
5984 });
5985 }
5986 view.allowed_tools
5987 .push(::buffa::types::borrow_str(&mut cur)?);
5988 }
5989 _ => {
5990 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
5991 let span_len = before_tag.len() - cur.len();
5992 view.__buffa_unknown_fields
5993 .push_raw(&before_tag[..span_len]);
5994 }
5995 }
5996 }
5997 ::core::result::Result::Ok(())
5998 }
5999 }
6000 impl<'a> ::buffa::MessageView<'a> for UpdateAgentSkillRequestView<'a> {
6001 type Owned = super::super::UpdateAgentSkillRequest;
6002 fn decode_view(
6003 buf: &'a [u8],
6004 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6005 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
6006 }
6007 fn decode_view_with_limit(
6008 buf: &'a [u8],
6009 depth: u32,
6010 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6011 Self::_decode_depth(buf, depth)
6012 }
6013 fn to_owned_message(&self) -> super::super::UpdateAgentSkillRequest {
6014 self.to_owned_from_source(None)
6015 }
6016 #[allow(clippy::useless_conversion, clippy::needless_update)]
6017 fn to_owned_from_source(
6018 &self,
6019 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
6020 ) -> super::super::UpdateAgentSkillRequest {
6021 #[allow(unused_imports)]
6022 use ::buffa::alloc::string::ToString as _;
6023 let _ = __buffa_src;
6024 super::super::UpdateAgentSkillRequest {
6025 name: self.name.to_string(),
6026 new_name: self.new_name.map(|s| s.to_string()),
6027 description: self.description.map(|s| s.to_string()),
6028 allowed_tools: self
6029 .allowed_tools
6030 .iter()
6031 .map(|s| s.to_string())
6032 .collect(),
6033 comment: self.comment.map(|s| s.to_string()),
6034 owner: self.owner.map(|s| s.to_string()),
6035 __buffa_unknown_fields: self
6036 .__buffa_unknown_fields
6037 .to_owned()
6038 .unwrap_or_default()
6039 .into(),
6040 ..::core::default::Default::default()
6041 }
6042 }
6043 }
6044 impl<'a> ::buffa::ViewEncode<'a> for UpdateAgentSkillRequestView<'a> {
6045 #[allow(clippy::needless_borrow, clippy::let_and_return)]
6046 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
6047 #[allow(unused_imports)]
6048 use ::buffa::Enumeration as _;
6049 let mut size = 0u32;
6050 if !self.name.is_empty() {
6051 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
6052 }
6053 if let Some(ref v) = self.new_name {
6054 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
6055 }
6056 if let Some(ref v) = self.description {
6057 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
6058 }
6059 for v in &self.allowed_tools {
6060 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
6061 }
6062 if let Some(ref v) = self.comment {
6063 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
6064 }
6065 if let Some(ref v) = self.owner {
6066 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
6067 }
6068 size += self.__buffa_unknown_fields.encoded_len() as u32;
6069 size
6070 }
6071 #[allow(clippy::needless_borrow)]
6072 fn write_to(
6073 &self,
6074 _cache: &mut ::buffa::SizeCache,
6075 buf: &mut impl ::buffa::bytes::BufMut,
6076 ) {
6077 #[allow(unused_imports)]
6078 use ::buffa::Enumeration as _;
6079 if !self.name.is_empty() {
6080 ::buffa::encoding::Tag::new(
6081 1u32,
6082 ::buffa::encoding::WireType::LengthDelimited,
6083 )
6084 .encode(buf);
6085 ::buffa::types::encode_string(&self.name, buf);
6086 }
6087 if let Some(ref v) = self.new_name {
6088 ::buffa::encoding::Tag::new(
6089 2u32,
6090 ::buffa::encoding::WireType::LengthDelimited,
6091 )
6092 .encode(buf);
6093 ::buffa::types::encode_string(v, buf);
6094 }
6095 if let Some(ref v) = self.description {
6096 ::buffa::encoding::Tag::new(
6097 3u32,
6098 ::buffa::encoding::WireType::LengthDelimited,
6099 )
6100 .encode(buf);
6101 ::buffa::types::encode_string(v, buf);
6102 }
6103 for v in &self.allowed_tools {
6104 ::buffa::encoding::Tag::new(
6105 4u32,
6106 ::buffa::encoding::WireType::LengthDelimited,
6107 )
6108 .encode(buf);
6109 ::buffa::types::encode_string(v, buf);
6110 }
6111 if let Some(ref v) = self.comment {
6112 ::buffa::encoding::Tag::new(
6113 5u32,
6114 ::buffa::encoding::WireType::LengthDelimited,
6115 )
6116 .encode(buf);
6117 ::buffa::types::encode_string(v, buf);
6118 }
6119 if let Some(ref v) = self.owner {
6120 ::buffa::encoding::Tag::new(
6121 6u32,
6122 ::buffa::encoding::WireType::LengthDelimited,
6123 )
6124 .encode(buf);
6125 ::buffa::types::encode_string(v, buf);
6126 }
6127 self.__buffa_unknown_fields.write_to(buf);
6128 }
6129 }
6130 impl<'__a> ::serde::Serialize for UpdateAgentSkillRequestView<'__a> {
6142 fn serialize<__S: ::serde::Serializer>(
6143 &self,
6144 __s: __S,
6145 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6146 use ::serde::ser::SerializeMap as _;
6147 let mut __map = __s.serialize_map(::core::option::Option::None)?;
6148 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
6149 __map.serialize_entry("name", self.name)?;
6150 }
6151 if let ::core::option::Option::Some(__v) = self.new_name {
6152 __map.serialize_entry("new_name", __v)?;
6153 }
6154 if let ::core::option::Option::Some(__v) = self.description {
6155 __map.serialize_entry("description", __v)?;
6156 }
6157 if !self.allowed_tools.is_empty() {
6158 __map.serialize_entry("allowed_tools", &*self.allowed_tools)?;
6159 }
6160 if let ::core::option::Option::Some(__v) = self.comment {
6161 __map.serialize_entry("comment", __v)?;
6162 }
6163 if let ::core::option::Option::Some(__v) = self.owner {
6164 __map.serialize_entry("owner", __v)?;
6165 }
6166 __map.end()
6167 }
6168 }
6169 impl<'a> ::buffa::MessageName for UpdateAgentSkillRequestView<'a> {
6170 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
6171 const NAME: &'static str = "UpdateAgentSkillRequest";
6172 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.UpdateAgentSkillRequest";
6173 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.UpdateAgentSkillRequest";
6174 }
6175 impl<'v> ::buffa::DefaultViewInstance for UpdateAgentSkillRequestView<'v> {
6176 fn default_view_instance<'a>() -> &'a Self
6177 where
6178 Self: 'a,
6179 {
6180 static VALUE: ::buffa::__private::OnceBox<
6181 UpdateAgentSkillRequestView<'static>,
6182 > = ::buffa::__private::OnceBox::new();
6183 VALUE
6184 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
6185 <UpdateAgentSkillRequestView<'static>>::default(),
6186 ))
6187 }
6188 }
6189 impl ::buffa::ViewReborrow for UpdateAgentSkillRequestView<'static> {
6190 type Reborrowed<'b> = UpdateAgentSkillRequestView<'b>;
6191 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
6192 this
6193 }
6194 }
6195 #[derive(Clone, Debug)]
6201 pub struct UpdateAgentSkillRequestOwnedView(
6202 ::buffa::OwnedView<UpdateAgentSkillRequestView<'static>>,
6203 );
6204 impl UpdateAgentSkillRequestOwnedView {
6205 pub fn decode(
6215 bytes: ::buffa::bytes::Bytes,
6216 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6217 ::core::result::Result::Ok(
6218 UpdateAgentSkillRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
6219 )
6220 }
6221 pub fn decode_with_options(
6229 bytes: ::buffa::bytes::Bytes,
6230 opts: &::buffa::DecodeOptions,
6231 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6232 ::core::result::Result::Ok(
6233 UpdateAgentSkillRequestOwnedView(
6234 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
6235 ),
6236 )
6237 }
6238 pub fn from_owned(
6245 msg: &super::super::UpdateAgentSkillRequest,
6246 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6247 ::core::result::Result::Ok(
6248 UpdateAgentSkillRequestOwnedView(
6249 ::buffa::OwnedView::from_owned(msg)?,
6250 ),
6251 )
6252 }
6253 #[must_use]
6255 pub fn view(&self) -> &UpdateAgentSkillRequestView<'_> {
6256 self.0.reborrow()
6257 }
6258 #[must_use]
6260 pub fn to_owned_message(&self) -> super::super::UpdateAgentSkillRequest {
6261 self.0.to_owned_message()
6262 }
6263 #[must_use]
6265 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
6266 self.0.bytes()
6267 }
6268 #[must_use]
6270 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
6271 self.0.into_bytes()
6272 }
6273 #[must_use]
6277 pub fn name(&self) -> &'_ str {
6278 self.0.reborrow().name
6279 }
6280 #[must_use]
6284 pub fn new_name(&self) -> ::core::option::Option<&'_ str> {
6285 self.0.reborrow().new_name
6286 }
6287 #[must_use]
6291 pub fn description(&self) -> ::core::option::Option<&'_ str> {
6292 self.0.reborrow().description
6293 }
6294 #[must_use]
6298 pub fn allowed_tools(&self) -> &::buffa::RepeatedView<'_, &'_ str> {
6299 &self.0.reborrow().allowed_tools
6300 }
6301 #[must_use]
6305 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
6306 self.0.reborrow().comment
6307 }
6308 #[must_use]
6312 pub fn owner(&self) -> ::core::option::Option<&'_ str> {
6313 self.0.reborrow().owner
6314 }
6315 }
6316 impl ::core::convert::From<
6317 ::buffa::OwnedView<UpdateAgentSkillRequestView<'static>>,
6318 > for UpdateAgentSkillRequestOwnedView {
6319 fn from(
6320 inner: ::buffa::OwnedView<UpdateAgentSkillRequestView<'static>>,
6321 ) -> Self {
6322 UpdateAgentSkillRequestOwnedView(inner)
6323 }
6324 }
6325 impl ::core::convert::From<UpdateAgentSkillRequestOwnedView>
6326 for ::buffa::OwnedView<UpdateAgentSkillRequestView<'static>> {
6327 fn from(wrapper: UpdateAgentSkillRequestOwnedView) -> Self {
6328 wrapper.0
6329 }
6330 }
6331 impl ::core::convert::AsRef<
6332 ::buffa::OwnedView<UpdateAgentSkillRequestView<'static>>,
6333 > for UpdateAgentSkillRequestOwnedView {
6334 fn as_ref(
6335 &self,
6336 ) -> &::buffa::OwnedView<UpdateAgentSkillRequestView<'static>> {
6337 &self.0
6338 }
6339 }
6340 impl ::buffa::HasMessageView for super::super::UpdateAgentSkillRequest {
6341 type View<'a> = UpdateAgentSkillRequestView<'a>;
6342 type ViewHandle = UpdateAgentSkillRequestOwnedView;
6343 }
6344 impl ::serde::Serialize for UpdateAgentSkillRequestOwnedView {
6345 fn serialize<__S: ::serde::Serializer>(
6346 &self,
6347 __s: __S,
6348 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6349 ::serde::Serialize::serialize(&self.0, __s)
6350 }
6351 }
6352 #[derive(Clone, Debug, Default)]
6353 pub struct DeleteAgentSkillRequestView<'a> {
6354 pub name: &'a str,
6358 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
6359 }
6360 impl<'a> DeleteAgentSkillRequestView<'a> {
6361 #[doc(hidden)]
6369 pub fn _decode_depth(
6370 buf: &'a [u8],
6371 depth: u32,
6372 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6373 let mut view = Self::default();
6374 view._merge_into_view(buf, depth)?;
6375 ::core::result::Result::Ok(view)
6376 }
6377 #[doc(hidden)]
6385 pub fn _merge_into_view(
6386 &mut self,
6387 buf: &'a [u8],
6388 depth: u32,
6389 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
6390 let _ = depth;
6391 #[allow(unused_variables)]
6392 let view = self;
6393 let mut cur: &'a [u8] = buf;
6394 while !cur.is_empty() {
6395 let before_tag = cur;
6396 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
6397 match tag.field_number() {
6398 1u32 => {
6399 if tag.wire_type()
6400 != ::buffa::encoding::WireType::LengthDelimited
6401 {
6402 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
6403 field_number: 1u32,
6404 expected: 2u8,
6405 actual: tag.wire_type() as u8,
6406 });
6407 }
6408 view.name = ::buffa::types::borrow_str(&mut cur)?;
6409 }
6410 _ => {
6411 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
6412 let span_len = before_tag.len() - cur.len();
6413 view.__buffa_unknown_fields
6414 .push_raw(&before_tag[..span_len]);
6415 }
6416 }
6417 }
6418 ::core::result::Result::Ok(())
6419 }
6420 }
6421 impl<'a> ::buffa::MessageView<'a> for DeleteAgentSkillRequestView<'a> {
6422 type Owned = super::super::DeleteAgentSkillRequest;
6423 fn decode_view(
6424 buf: &'a [u8],
6425 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6426 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
6427 }
6428 fn decode_view_with_limit(
6429 buf: &'a [u8],
6430 depth: u32,
6431 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6432 Self::_decode_depth(buf, depth)
6433 }
6434 fn to_owned_message(&self) -> super::super::DeleteAgentSkillRequest {
6435 self.to_owned_from_source(None)
6436 }
6437 #[allow(clippy::useless_conversion, clippy::needless_update)]
6438 fn to_owned_from_source(
6439 &self,
6440 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
6441 ) -> super::super::DeleteAgentSkillRequest {
6442 #[allow(unused_imports)]
6443 use ::buffa::alloc::string::ToString as _;
6444 let _ = __buffa_src;
6445 super::super::DeleteAgentSkillRequest {
6446 name: self.name.to_string(),
6447 __buffa_unknown_fields: self
6448 .__buffa_unknown_fields
6449 .to_owned()
6450 .unwrap_or_default()
6451 .into(),
6452 ..::core::default::Default::default()
6453 }
6454 }
6455 }
6456 impl<'a> ::buffa::ViewEncode<'a> for DeleteAgentSkillRequestView<'a> {
6457 #[allow(clippy::needless_borrow, clippy::let_and_return)]
6458 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
6459 #[allow(unused_imports)]
6460 use ::buffa::Enumeration as _;
6461 let mut size = 0u32;
6462 if !self.name.is_empty() {
6463 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
6464 }
6465 size += self.__buffa_unknown_fields.encoded_len() as u32;
6466 size
6467 }
6468 #[allow(clippy::needless_borrow)]
6469 fn write_to(
6470 &self,
6471 _cache: &mut ::buffa::SizeCache,
6472 buf: &mut impl ::buffa::bytes::BufMut,
6473 ) {
6474 #[allow(unused_imports)]
6475 use ::buffa::Enumeration as _;
6476 if !self.name.is_empty() {
6477 ::buffa::encoding::Tag::new(
6478 1u32,
6479 ::buffa::encoding::WireType::LengthDelimited,
6480 )
6481 .encode(buf);
6482 ::buffa::types::encode_string(&self.name, buf);
6483 }
6484 self.__buffa_unknown_fields.write_to(buf);
6485 }
6486 }
6487 impl<'__a> ::serde::Serialize for DeleteAgentSkillRequestView<'__a> {
6499 fn serialize<__S: ::serde::Serializer>(
6500 &self,
6501 __s: __S,
6502 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6503 use ::serde::ser::SerializeMap as _;
6504 let mut __map = __s.serialize_map(::core::option::Option::None)?;
6505 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
6506 __map.serialize_entry("name", self.name)?;
6507 }
6508 __map.end()
6509 }
6510 }
6511 impl<'a> ::buffa::MessageName for DeleteAgentSkillRequestView<'a> {
6512 const PACKAGE: &'static str = "unitycatalog.agent_skills.v0alpha1";
6513 const NAME: &'static str = "DeleteAgentSkillRequest";
6514 const FULL_NAME: &'static str = "unitycatalog.agent_skills.v0alpha1.DeleteAgentSkillRequest";
6515 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.agent_skills.v0alpha1.DeleteAgentSkillRequest";
6516 }
6517 impl<'v> ::buffa::DefaultViewInstance for DeleteAgentSkillRequestView<'v> {
6518 fn default_view_instance<'a>() -> &'a Self
6519 where
6520 Self: 'a,
6521 {
6522 static VALUE: ::buffa::__private::OnceBox<
6523 DeleteAgentSkillRequestView<'static>,
6524 > = ::buffa::__private::OnceBox::new();
6525 VALUE
6526 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
6527 <DeleteAgentSkillRequestView<'static>>::default(),
6528 ))
6529 }
6530 }
6531 impl ::buffa::ViewReborrow for DeleteAgentSkillRequestView<'static> {
6532 type Reborrowed<'b> = DeleteAgentSkillRequestView<'b>;
6533 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
6534 this
6535 }
6536 }
6537 #[derive(Clone, Debug)]
6543 pub struct DeleteAgentSkillRequestOwnedView(
6544 ::buffa::OwnedView<DeleteAgentSkillRequestView<'static>>,
6545 );
6546 impl DeleteAgentSkillRequestOwnedView {
6547 pub fn decode(
6557 bytes: ::buffa::bytes::Bytes,
6558 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6559 ::core::result::Result::Ok(
6560 DeleteAgentSkillRequestOwnedView(::buffa::OwnedView::decode(bytes)?),
6561 )
6562 }
6563 pub fn decode_with_options(
6571 bytes: ::buffa::bytes::Bytes,
6572 opts: &::buffa::DecodeOptions,
6573 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6574 ::core::result::Result::Ok(
6575 DeleteAgentSkillRequestOwnedView(
6576 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
6577 ),
6578 )
6579 }
6580 pub fn from_owned(
6587 msg: &super::super::DeleteAgentSkillRequest,
6588 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
6589 ::core::result::Result::Ok(
6590 DeleteAgentSkillRequestOwnedView(
6591 ::buffa::OwnedView::from_owned(msg)?,
6592 ),
6593 )
6594 }
6595 #[must_use]
6597 pub fn view(&self) -> &DeleteAgentSkillRequestView<'_> {
6598 self.0.reborrow()
6599 }
6600 #[must_use]
6602 pub fn to_owned_message(&self) -> super::super::DeleteAgentSkillRequest {
6603 self.0.to_owned_message()
6604 }
6605 #[must_use]
6607 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
6608 self.0.bytes()
6609 }
6610 #[must_use]
6612 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
6613 self.0.into_bytes()
6614 }
6615 #[must_use]
6619 pub fn name(&self) -> &'_ str {
6620 self.0.reborrow().name
6621 }
6622 }
6623 impl ::core::convert::From<
6624 ::buffa::OwnedView<DeleteAgentSkillRequestView<'static>>,
6625 > for DeleteAgentSkillRequestOwnedView {
6626 fn from(
6627 inner: ::buffa::OwnedView<DeleteAgentSkillRequestView<'static>>,
6628 ) -> Self {
6629 DeleteAgentSkillRequestOwnedView(inner)
6630 }
6631 }
6632 impl ::core::convert::From<DeleteAgentSkillRequestOwnedView>
6633 for ::buffa::OwnedView<DeleteAgentSkillRequestView<'static>> {
6634 fn from(wrapper: DeleteAgentSkillRequestOwnedView) -> Self {
6635 wrapper.0
6636 }
6637 }
6638 impl ::core::convert::AsRef<
6639 ::buffa::OwnedView<DeleteAgentSkillRequestView<'static>>,
6640 > for DeleteAgentSkillRequestOwnedView {
6641 fn as_ref(
6642 &self,
6643 ) -> &::buffa::OwnedView<DeleteAgentSkillRequestView<'static>> {
6644 &self.0
6645 }
6646 }
6647 impl ::buffa::HasMessageView for super::super::DeleteAgentSkillRequest {
6648 type View<'a> = DeleteAgentSkillRequestView<'a>;
6649 type ViewHandle = DeleteAgentSkillRequestOwnedView;
6650 }
6651 impl ::serde::Serialize for DeleteAgentSkillRequestOwnedView {
6652 fn serialize<__S: ::serde::Serializer>(
6653 &self,
6654 __s: __S,
6655 ) -> ::core::result::Result<__S::Ok, __S::Error> {
6656 ::serde::Serialize::serialize(&self.0, __s)
6657 }
6658 }
6659 }
6660 pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
6662 reg.register_json_any(super::__AGENT_SKILL_JSON_ANY);
6663 reg.register_json_any(super::__LIST_AGENT_SKILLS_REQUEST_JSON_ANY);
6664 reg.register_json_any(super::__LIST_AGENT_SKILLS_RESPONSE_JSON_ANY);
6665 reg.register_json_any(super::__CREATE_AGENT_SKILL_REQUEST_JSON_ANY);
6666 reg.register_json_any(super::__GET_AGENT_SKILL_REQUEST_JSON_ANY);
6667 reg.register_json_any(super::__UPDATE_AGENT_SKILL_REQUEST_JSON_ANY);
6668 reg.register_json_any(super::__DELETE_AGENT_SKILL_REQUEST_JSON_ANY);
6669 }
6670}
6671#[doc(inline)]
6672pub use self::__buffa::view::AgentSkillView;
6673#[doc(inline)]
6674pub use self::__buffa::view::AgentSkillOwnedView;
6675#[doc(inline)]
6676pub use self::__buffa::view::ListAgentSkillsRequestView;
6677#[doc(inline)]
6678pub use self::__buffa::view::ListAgentSkillsRequestOwnedView;
6679#[doc(inline)]
6680pub use self::__buffa::view::ListAgentSkillsResponseView;
6681#[doc(inline)]
6682pub use self::__buffa::view::ListAgentSkillsResponseOwnedView;
6683#[doc(inline)]
6684pub use self::__buffa::view::CreateAgentSkillRequestView;
6685#[doc(inline)]
6686pub use self::__buffa::view::CreateAgentSkillRequestOwnedView;
6687#[doc(inline)]
6688pub use self::__buffa::view::GetAgentSkillRequestView;
6689#[doc(inline)]
6690pub use self::__buffa::view::GetAgentSkillRequestOwnedView;
6691#[doc(inline)]
6692pub use self::__buffa::view::UpdateAgentSkillRequestView;
6693#[doc(inline)]
6694pub use self::__buffa::view::UpdateAgentSkillRequestOwnedView;
6695#[doc(inline)]
6696pub use self::__buffa::view::DeleteAgentSkillRequestView;
6697#[doc(inline)]
6698pub use self::__buffa::view::DeleteAgentSkillRequestOwnedView;
6699#[doc(inline)]
6700pub use self::__buffa::register_types;