1#[derive(Clone, PartialEq, Default)]
4#[derive(::serde::Serialize, ::serde::Deserialize)]
5#[serde(default)]
6pub struct ExternalLocation {
7 #[serde(
11 rename = "name",
12 with = "::buffa::json_helpers::proto_string",
13 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
14 )]
15 pub name: ::buffa::alloc::string::String,
16 #[serde(
20 rename = "url",
21 with = "::buffa::json_helpers::proto_string",
22 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
23 )]
24 pub url: ::buffa::alloc::string::String,
25 #[serde(
29 rename = "credential_name",
30 alias = "credentialName",
31 with = "::buffa::json_helpers::proto_string",
32 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
33 )]
34 pub credential_name: ::buffa::alloc::string::String,
35 #[serde(
39 rename = "read_only",
40 alias = "readOnly",
41 with = "::buffa::json_helpers::proto_bool",
42 skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
43 )]
44 pub read_only: bool,
45 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
49 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
50 #[serde(rename = "owner", skip_serializing_if = "::core::option::Option::is_none")]
54 pub owner: ::core::option::Option<::buffa::alloc::string::String>,
55 #[serde(
62 rename = "credential_id",
63 alias = "credentialId",
64 with = "::buffa::json_helpers::proto_string",
65 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
66 )]
67 pub credential_id: ::buffa::alloc::string::String,
68 #[serde(
72 rename = "created_at",
73 alias = "createdAt",
74 with = "::buffa::json_helpers::opt_int64",
75 skip_serializing_if = "::core::option::Option::is_none"
76 )]
77 pub created_at: ::core::option::Option<i64>,
78 #[serde(
82 rename = "created_by",
83 alias = "createdBy",
84 skip_serializing_if = "::core::option::Option::is_none"
85 )]
86 pub created_by: ::core::option::Option<::buffa::alloc::string::String>,
87 #[serde(
91 rename = "updated_at",
92 alias = "updatedAt",
93 with = "::buffa::json_helpers::opt_int64",
94 skip_serializing_if = "::core::option::Option::is_none"
95 )]
96 pub updated_at: ::core::option::Option<i64>,
97 #[serde(
101 rename = "updated_by",
102 alias = "updatedBy",
103 skip_serializing_if = "::core::option::Option::is_none"
104 )]
105 pub updated_by: ::core::option::Option<::buffa::alloc::string::String>,
106 #[serde(
111 rename = "browse_only",
112 alias = "browseOnly",
113 skip_serializing_if = "::core::option::Option::is_none"
114 )]
115 pub browse_only: ::core::option::Option<bool>,
116 #[serde(
118 rename = "external_location_id",
119 alias = "externalLocationId",
120 skip_serializing_if = "::core::option::Option::is_none"
121 )]
122 pub external_location_id: ::core::option::Option<::buffa::alloc::string::String>,
123 #[serde(skip)]
124 #[doc(hidden)]
125 pub __buffa_unknown_fields: ::buffa::UnknownFields,
126}
127impl ::core::fmt::Debug for ExternalLocation {
128 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
129 f.debug_struct("ExternalLocation")
130 .field("name", &self.name)
131 .field("url", &self.url)
132 .field("credential_name", &self.credential_name)
133 .field("read_only", &self.read_only)
134 .field("comment", &self.comment)
135 .field("owner", &self.owner)
136 .field("credential_id", &self.credential_id)
137 .field("created_at", &self.created_at)
138 .field("created_by", &self.created_by)
139 .field("updated_at", &self.updated_at)
140 .field("updated_by", &self.updated_by)
141 .field("browse_only", &self.browse_only)
142 .field("external_location_id", &self.external_location_id)
143 .finish()
144 }
145}
146impl ExternalLocation {
147 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ExternalLocation";
152}
153impl ExternalLocation {
154 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
155 #[inline]
156 pub fn with_comment(
158 mut self,
159 value: impl Into<::buffa::alloc::string::String>,
160 ) -> Self {
161 self.comment = Some(value.into());
162 self
163 }
164 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
165 #[inline]
166 pub fn with_owner(
168 mut self,
169 value: impl Into<::buffa::alloc::string::String>,
170 ) -> Self {
171 self.owner = Some(value.into());
172 self
173 }
174 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
175 #[inline]
176 pub fn with_created_at(mut self, value: i64) -> Self {
178 self.created_at = Some(value);
179 self
180 }
181 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
182 #[inline]
183 pub fn with_created_by(
185 mut self,
186 value: impl Into<::buffa::alloc::string::String>,
187 ) -> Self {
188 self.created_by = Some(value.into());
189 self
190 }
191 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
192 #[inline]
193 pub fn with_updated_at(mut self, value: i64) -> Self {
195 self.updated_at = Some(value);
196 self
197 }
198 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
199 #[inline]
200 pub fn with_updated_by(
202 mut self,
203 value: impl Into<::buffa::alloc::string::String>,
204 ) -> Self {
205 self.updated_by = Some(value.into());
206 self
207 }
208 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
209 #[inline]
210 pub fn with_browse_only(mut self, value: bool) -> Self {
212 self.browse_only = Some(value);
213 self
214 }
215 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
216 #[inline]
217 pub fn with_external_location_id(
219 mut self,
220 value: impl Into<::buffa::alloc::string::String>,
221 ) -> Self {
222 self.external_location_id = Some(value.into());
223 self
224 }
225}
226impl ::buffa::DefaultInstance for ExternalLocation {
227 fn default_instance() -> &'static Self {
228 static VALUE: ::buffa::__private::OnceBox<ExternalLocation> = ::buffa::__private::OnceBox::new();
229 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
230 }
231}
232impl ::buffa::MessageName for ExternalLocation {
233 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
234 const NAME: &'static str = "ExternalLocation";
235 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.ExternalLocation";
236 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ExternalLocation";
237}
238impl ::buffa::Message for ExternalLocation {
239 #[allow(clippy::let_and_return)]
245 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
246 #[allow(unused_imports)]
247 use ::buffa::Enumeration as _;
248 let mut size = 0u32;
249 if !self.name.is_empty() {
250 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
251 }
252 if !self.url.is_empty() {
253 size += 1u32 + ::buffa::types::string_encoded_len(&self.url) as u32;
254 }
255 if !self.credential_name.is_empty() {
256 size
257 += 1u32
258 + ::buffa::types::string_encoded_len(&self.credential_name) as u32;
259 }
260 if self.read_only {
261 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
262 }
263 if let Some(ref v) = self.comment {
264 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
265 }
266 if let Some(ref v) = self.owner {
267 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
268 }
269 if !self.credential_id.is_empty() {
270 size
271 += 1u32 + ::buffa::types::string_encoded_len(&self.credential_id) as u32;
272 }
273 if let Some(v) = self.created_at {
274 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
275 }
276 if let Some(ref v) = self.created_by {
277 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
278 }
279 if let Some(v) = self.updated_at {
280 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
281 }
282 if let Some(ref v) = self.updated_by {
283 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
284 }
285 if self.browse_only.is_some() {
286 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
287 }
288 if let Some(ref v) = self.external_location_id {
289 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
290 }
291 size += self.__buffa_unknown_fields.encoded_len() as u32;
292 size
293 }
294 fn write_to(
295 &self,
296 _cache: &mut ::buffa::SizeCache,
297 buf: &mut impl ::buffa::bytes::BufMut,
298 ) {
299 #[allow(unused_imports)]
300 use ::buffa::Enumeration as _;
301 if !self.name.is_empty() {
302 ::buffa::encoding::Tag::new(
303 1u32,
304 ::buffa::encoding::WireType::LengthDelimited,
305 )
306 .encode(buf);
307 ::buffa::types::encode_string(&self.name, buf);
308 }
309 if !self.url.is_empty() {
310 ::buffa::encoding::Tag::new(
311 2u32,
312 ::buffa::encoding::WireType::LengthDelimited,
313 )
314 .encode(buf);
315 ::buffa::types::encode_string(&self.url, buf);
316 }
317 if !self.credential_name.is_empty() {
318 ::buffa::encoding::Tag::new(
319 3u32,
320 ::buffa::encoding::WireType::LengthDelimited,
321 )
322 .encode(buf);
323 ::buffa::types::encode_string(&self.credential_name, buf);
324 }
325 if self.read_only {
326 ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
327 .encode(buf);
328 ::buffa::types::encode_bool(self.read_only, buf);
329 }
330 if let Some(ref v) = self.comment {
331 ::buffa::encoding::Tag::new(
332 5u32,
333 ::buffa::encoding::WireType::LengthDelimited,
334 )
335 .encode(buf);
336 ::buffa::types::encode_string(v, buf);
337 }
338 if let Some(ref v) = self.owner {
339 ::buffa::encoding::Tag::new(
340 6u32,
341 ::buffa::encoding::WireType::LengthDelimited,
342 )
343 .encode(buf);
344 ::buffa::types::encode_string(v, buf);
345 }
346 if !self.credential_id.is_empty() {
347 ::buffa::encoding::Tag::new(
348 8u32,
349 ::buffa::encoding::WireType::LengthDelimited,
350 )
351 .encode(buf);
352 ::buffa::types::encode_string(&self.credential_id, buf);
353 }
354 if let Some(v) = self.created_at {
355 ::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
356 .encode(buf);
357 ::buffa::types::encode_int64(v, buf);
358 }
359 if let Some(ref v) = self.created_by {
360 ::buffa::encoding::Tag::new(
361 10u32,
362 ::buffa::encoding::WireType::LengthDelimited,
363 )
364 .encode(buf);
365 ::buffa::types::encode_string(v, buf);
366 }
367 if let Some(v) = self.updated_at {
368 ::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
369 .encode(buf);
370 ::buffa::types::encode_int64(v, buf);
371 }
372 if let Some(ref v) = self.updated_by {
373 ::buffa::encoding::Tag::new(
374 12u32,
375 ::buffa::encoding::WireType::LengthDelimited,
376 )
377 .encode(buf);
378 ::buffa::types::encode_string(v, buf);
379 }
380 if let Some(v) = self.browse_only {
381 ::buffa::encoding::Tag::new(13u32, ::buffa::encoding::WireType::Varint)
382 .encode(buf);
383 ::buffa::types::encode_bool(v, buf);
384 }
385 if let Some(ref v) = self.external_location_id {
386 ::buffa::encoding::Tag::new(
387 100u32,
388 ::buffa::encoding::WireType::LengthDelimited,
389 )
390 .encode(buf);
391 ::buffa::types::encode_string(v, buf);
392 }
393 self.__buffa_unknown_fields.write_to(buf);
394 }
395 fn merge_field(
396 &mut self,
397 tag: ::buffa::encoding::Tag,
398 buf: &mut impl ::buffa::bytes::Buf,
399 depth: u32,
400 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
401 #[allow(unused_imports)]
402 use ::buffa::bytes::Buf as _;
403 #[allow(unused_imports)]
404 use ::buffa::Enumeration as _;
405 match tag.field_number() {
406 1u32 => {
407 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
408 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
409 field_number: 1u32,
410 expected: 2u8,
411 actual: tag.wire_type() as u8,
412 });
413 }
414 ::buffa::types::merge_string(&mut self.name, buf)?;
415 }
416 2u32 => {
417 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
418 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
419 field_number: 2u32,
420 expected: 2u8,
421 actual: tag.wire_type() as u8,
422 });
423 }
424 ::buffa::types::merge_string(&mut self.url, buf)?;
425 }
426 3u32 => {
427 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
428 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
429 field_number: 3u32,
430 expected: 2u8,
431 actual: tag.wire_type() as u8,
432 });
433 }
434 ::buffa::types::merge_string(&mut self.credential_name, buf)?;
435 }
436 4u32 => {
437 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
438 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
439 field_number: 4u32,
440 expected: 0u8,
441 actual: tag.wire_type() as u8,
442 });
443 }
444 self.read_only = ::buffa::types::decode_bool(buf)?;
445 }
446 5u32 => {
447 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
448 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
449 field_number: 5u32,
450 expected: 2u8,
451 actual: tag.wire_type() as u8,
452 });
453 }
454 ::buffa::types::merge_string(
455 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
456 buf,
457 )?;
458 }
459 6u32 => {
460 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
461 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
462 field_number: 6u32,
463 expected: 2u8,
464 actual: tag.wire_type() as u8,
465 });
466 }
467 ::buffa::types::merge_string(
468 self.owner.get_or_insert_with(::buffa::alloc::string::String::new),
469 buf,
470 )?;
471 }
472 8u32 => {
473 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
474 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
475 field_number: 8u32,
476 expected: 2u8,
477 actual: tag.wire_type() as u8,
478 });
479 }
480 ::buffa::types::merge_string(&mut self.credential_id, buf)?;
481 }
482 9u32 => {
483 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
484 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
485 field_number: 9u32,
486 expected: 0u8,
487 actual: tag.wire_type() as u8,
488 });
489 }
490 self.created_at = ::core::option::Option::Some(
491 ::buffa::types::decode_int64(buf)?,
492 );
493 }
494 10u32 => {
495 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
496 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
497 field_number: 10u32,
498 expected: 2u8,
499 actual: tag.wire_type() as u8,
500 });
501 }
502 ::buffa::types::merge_string(
503 self
504 .created_by
505 .get_or_insert_with(::buffa::alloc::string::String::new),
506 buf,
507 )?;
508 }
509 11u32 => {
510 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
511 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
512 field_number: 11u32,
513 expected: 0u8,
514 actual: tag.wire_type() as u8,
515 });
516 }
517 self.updated_at = ::core::option::Option::Some(
518 ::buffa::types::decode_int64(buf)?,
519 );
520 }
521 12u32 => {
522 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
523 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
524 field_number: 12u32,
525 expected: 2u8,
526 actual: tag.wire_type() as u8,
527 });
528 }
529 ::buffa::types::merge_string(
530 self
531 .updated_by
532 .get_or_insert_with(::buffa::alloc::string::String::new),
533 buf,
534 )?;
535 }
536 13u32 => {
537 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
538 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
539 field_number: 13u32,
540 expected: 0u8,
541 actual: tag.wire_type() as u8,
542 });
543 }
544 self.browse_only = ::core::option::Option::Some(
545 ::buffa::types::decode_bool(buf)?,
546 );
547 }
548 100u32 => {
549 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
550 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
551 field_number: 100u32,
552 expected: 2u8,
553 actual: tag.wire_type() as u8,
554 });
555 }
556 ::buffa::types::merge_string(
557 self
558 .external_location_id
559 .get_or_insert_with(::buffa::alloc::string::String::new),
560 buf,
561 )?;
562 }
563 _ => {
564 self.__buffa_unknown_fields
565 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
566 }
567 }
568 ::core::result::Result::Ok(())
569 }
570 fn clear(&mut self) {
571 self.name.clear();
572 self.url.clear();
573 self.credential_name.clear();
574 self.read_only = false;
575 self.comment = ::core::option::Option::None;
576 self.owner = ::core::option::Option::None;
577 self.credential_id.clear();
578 self.created_at = ::core::option::Option::None;
579 self.created_by = ::core::option::Option::None;
580 self.updated_at = ::core::option::Option::None;
581 self.updated_by = ::core::option::Option::None;
582 self.browse_only = ::core::option::Option::None;
583 self.external_location_id = ::core::option::Option::None;
584 self.__buffa_unknown_fields.clear();
585 }
586}
587impl ::buffa::ExtensionSet for ExternalLocation {
588 const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.ExternalLocation";
589 fn unknown_fields(&self) -> &::buffa::UnknownFields {
590 &self.__buffa_unknown_fields
591 }
592 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
593 &mut self.__buffa_unknown_fields
594 }
595}
596impl ::buffa::json_helpers::ProtoElemJson for ExternalLocation {
597 fn serialize_proto_json<S: ::serde::Serializer>(
598 v: &Self,
599 s: S,
600 ) -> ::core::result::Result<S::Ok, S::Error> {
601 ::serde::Serialize::serialize(v, s)
602 }
603 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
604 d: D,
605 ) -> ::core::result::Result<Self, D::Error> {
606 <Self as ::serde::Deserialize>::deserialize(d)
607 }
608}
609#[doc(hidden)]
610pub const __EXTERNAL_LOCATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
611 type_url: "type.googleapis.com/unitycatalog.external_locations.v1.ExternalLocation",
612 to_json: ::buffa::type_registry::any_to_json::<ExternalLocation>,
613 from_json: ::buffa::type_registry::any_from_json::<ExternalLocation>,
614 is_wkt: false,
615};
616#[derive(Clone, PartialEq, Default)]
618#[derive(::serde::Serialize, ::serde::Deserialize)]
619#[serde(default)]
620pub struct ListExternalLocationsRequest {
621 #[serde(
625 rename = "max_results",
626 alias = "maxResults",
627 with = "::buffa::json_helpers::opt_int32",
628 skip_serializing_if = "::core::option::Option::is_none"
629 )]
630 pub max_results: ::core::option::Option<i32>,
631 #[serde(
635 rename = "page_token",
636 alias = "pageToken",
637 skip_serializing_if = "::core::option::Option::is_none"
638 )]
639 pub page_token: ::core::option::Option<::buffa::alloc::string::String>,
640 #[serde(
644 rename = "include_browse",
645 alias = "includeBrowse",
646 skip_serializing_if = "::core::option::Option::is_none"
647 )]
648 pub include_browse: ::core::option::Option<bool>,
649 #[serde(skip)]
650 #[doc(hidden)]
651 pub __buffa_unknown_fields: ::buffa::UnknownFields,
652}
653impl ::core::fmt::Debug for ListExternalLocationsRequest {
654 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
655 f.debug_struct("ListExternalLocationsRequest")
656 .field("max_results", &self.max_results)
657 .field("page_token", &self.page_token)
658 .field("include_browse", &self.include_browse)
659 .finish()
660 }
661}
662impl ListExternalLocationsRequest {
663 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsRequest";
668}
669impl ListExternalLocationsRequest {
670 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
671 #[inline]
672 pub fn with_max_results(mut self, value: i32) -> Self {
674 self.max_results = Some(value);
675 self
676 }
677 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
678 #[inline]
679 pub fn with_page_token(
681 mut self,
682 value: impl Into<::buffa::alloc::string::String>,
683 ) -> Self {
684 self.page_token = Some(value.into());
685 self
686 }
687 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
688 #[inline]
689 pub fn with_include_browse(mut self, value: bool) -> Self {
691 self.include_browse = Some(value);
692 self
693 }
694}
695impl ::buffa::DefaultInstance for ListExternalLocationsRequest {
696 fn default_instance() -> &'static Self {
697 static VALUE: ::buffa::__private::OnceBox<ListExternalLocationsRequest> = ::buffa::__private::OnceBox::new();
698 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
699 }
700}
701impl ::buffa::MessageName for ListExternalLocationsRequest {
702 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
703 const NAME: &'static str = "ListExternalLocationsRequest";
704 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.ListExternalLocationsRequest";
705 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsRequest";
706}
707impl ::buffa::Message for ListExternalLocationsRequest {
708 #[allow(clippy::let_and_return)]
714 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
715 #[allow(unused_imports)]
716 use ::buffa::Enumeration as _;
717 let mut size = 0u32;
718 if let Some(v) = self.max_results {
719 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
720 }
721 if let Some(ref v) = self.page_token {
722 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
723 }
724 if self.include_browse.is_some() {
725 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
726 }
727 size += self.__buffa_unknown_fields.encoded_len() as u32;
728 size
729 }
730 fn write_to(
731 &self,
732 _cache: &mut ::buffa::SizeCache,
733 buf: &mut impl ::buffa::bytes::BufMut,
734 ) {
735 #[allow(unused_imports)]
736 use ::buffa::Enumeration as _;
737 if let Some(v) = self.max_results {
738 ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
739 .encode(buf);
740 ::buffa::types::encode_int32(v, buf);
741 }
742 if let Some(ref v) = self.page_token {
743 ::buffa::encoding::Tag::new(
744 3u32,
745 ::buffa::encoding::WireType::LengthDelimited,
746 )
747 .encode(buf);
748 ::buffa::types::encode_string(v, buf);
749 }
750 if let Some(v) = self.include_browse {
751 ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
752 .encode(buf);
753 ::buffa::types::encode_bool(v, buf);
754 }
755 self.__buffa_unknown_fields.write_to(buf);
756 }
757 fn merge_field(
758 &mut self,
759 tag: ::buffa::encoding::Tag,
760 buf: &mut impl ::buffa::bytes::Buf,
761 depth: u32,
762 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
763 #[allow(unused_imports)]
764 use ::buffa::bytes::Buf as _;
765 #[allow(unused_imports)]
766 use ::buffa::Enumeration as _;
767 match tag.field_number() {
768 2u32 => {
769 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
770 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
771 field_number: 2u32,
772 expected: 0u8,
773 actual: tag.wire_type() as u8,
774 });
775 }
776 self.max_results = ::core::option::Option::Some(
777 ::buffa::types::decode_int32(buf)?,
778 );
779 }
780 3u32 => {
781 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
782 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
783 field_number: 3u32,
784 expected: 2u8,
785 actual: tag.wire_type() as u8,
786 });
787 }
788 ::buffa::types::merge_string(
789 self
790 .page_token
791 .get_or_insert_with(::buffa::alloc::string::String::new),
792 buf,
793 )?;
794 }
795 4u32 => {
796 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
797 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
798 field_number: 4u32,
799 expected: 0u8,
800 actual: tag.wire_type() as u8,
801 });
802 }
803 self.include_browse = ::core::option::Option::Some(
804 ::buffa::types::decode_bool(buf)?,
805 );
806 }
807 _ => {
808 self.__buffa_unknown_fields
809 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
810 }
811 }
812 ::core::result::Result::Ok(())
813 }
814 fn clear(&mut self) {
815 self.max_results = ::core::option::Option::None;
816 self.page_token = ::core::option::Option::None;
817 self.include_browse = ::core::option::Option::None;
818 self.__buffa_unknown_fields.clear();
819 }
820}
821impl ::buffa::ExtensionSet for ListExternalLocationsRequest {
822 const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.ListExternalLocationsRequest";
823 fn unknown_fields(&self) -> &::buffa::UnknownFields {
824 &self.__buffa_unknown_fields
825 }
826 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
827 &mut self.__buffa_unknown_fields
828 }
829}
830impl ::buffa::json_helpers::ProtoElemJson for ListExternalLocationsRequest {
831 fn serialize_proto_json<S: ::serde::Serializer>(
832 v: &Self,
833 s: S,
834 ) -> ::core::result::Result<S::Ok, S::Error> {
835 ::serde::Serialize::serialize(v, s)
836 }
837 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
838 d: D,
839 ) -> ::core::result::Result<Self, D::Error> {
840 <Self as ::serde::Deserialize>::deserialize(d)
841 }
842}
843#[doc(hidden)]
844pub const __LIST_EXTERNAL_LOCATIONS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
845 type_url: "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsRequest",
846 to_json: ::buffa::type_registry::any_to_json::<ListExternalLocationsRequest>,
847 from_json: ::buffa::type_registry::any_from_json::<ListExternalLocationsRequest>,
848 is_wkt: false,
849};
850#[derive(Clone, PartialEq, Default)]
852#[derive(::serde::Serialize, ::serde::Deserialize)]
853#[serde(default)]
854pub struct ListExternalLocationsResponse {
855 #[serde(
859 rename = "external_locations",
860 alias = "externalLocations",
861 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
862 deserialize_with = "::buffa::json_helpers::null_as_default"
863 )]
864 pub external_locations: ::buffa::alloc::vec::Vec<ExternalLocation>,
865 #[serde(
869 rename = "next_page_token",
870 alias = "nextPageToken",
871 skip_serializing_if = "::core::option::Option::is_none"
872 )]
873 pub next_page_token: ::core::option::Option<::buffa::alloc::string::String>,
874 #[serde(skip)]
875 #[doc(hidden)]
876 pub __buffa_unknown_fields: ::buffa::UnknownFields,
877}
878impl ::core::fmt::Debug for ListExternalLocationsResponse {
879 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
880 f.debug_struct("ListExternalLocationsResponse")
881 .field("external_locations", &self.external_locations)
882 .field("next_page_token", &self.next_page_token)
883 .finish()
884 }
885}
886impl ListExternalLocationsResponse {
887 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsResponse";
892}
893impl ListExternalLocationsResponse {
894 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
895 #[inline]
896 pub fn with_next_page_token(
898 mut self,
899 value: impl Into<::buffa::alloc::string::String>,
900 ) -> Self {
901 self.next_page_token = Some(value.into());
902 self
903 }
904}
905impl ::buffa::DefaultInstance for ListExternalLocationsResponse {
906 fn default_instance() -> &'static Self {
907 static VALUE: ::buffa::__private::OnceBox<ListExternalLocationsResponse> = ::buffa::__private::OnceBox::new();
908 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
909 }
910}
911impl ::buffa::MessageName for ListExternalLocationsResponse {
912 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
913 const NAME: &'static str = "ListExternalLocationsResponse";
914 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.ListExternalLocationsResponse";
915 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsResponse";
916}
917impl ::buffa::Message for ListExternalLocationsResponse {
918 #[allow(clippy::let_and_return)]
924 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
925 #[allow(unused_imports)]
926 use ::buffa::Enumeration as _;
927 let mut size = 0u32;
928 for v in &self.external_locations {
929 let __slot = __cache.reserve();
930 let inner_size = v.compute_size(__cache);
931 __cache.set(__slot, inner_size);
932 size
933 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
934 + inner_size;
935 }
936 if let Some(ref v) = self.next_page_token {
937 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
938 }
939 size += self.__buffa_unknown_fields.encoded_len() as u32;
940 size
941 }
942 fn write_to(
943 &self,
944 __cache: &mut ::buffa::SizeCache,
945 buf: &mut impl ::buffa::bytes::BufMut,
946 ) {
947 #[allow(unused_imports)]
948 use ::buffa::Enumeration as _;
949 for v in &self.external_locations {
950 ::buffa::encoding::Tag::new(
951 1u32,
952 ::buffa::encoding::WireType::LengthDelimited,
953 )
954 .encode(buf);
955 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
956 v.write_to(__cache, buf);
957 }
958 if let Some(ref v) = self.next_page_token {
959 ::buffa::encoding::Tag::new(
960 2u32,
961 ::buffa::encoding::WireType::LengthDelimited,
962 )
963 .encode(buf);
964 ::buffa::types::encode_string(v, buf);
965 }
966 self.__buffa_unknown_fields.write_to(buf);
967 }
968 fn merge_field(
969 &mut self,
970 tag: ::buffa::encoding::Tag,
971 buf: &mut impl ::buffa::bytes::Buf,
972 depth: u32,
973 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
974 #[allow(unused_imports)]
975 use ::buffa::bytes::Buf as _;
976 #[allow(unused_imports)]
977 use ::buffa::Enumeration as _;
978 match tag.field_number() {
979 1u32 => {
980 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
981 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
982 field_number: 1u32,
983 expected: 2u8,
984 actual: tag.wire_type() as u8,
985 });
986 }
987 let mut elem = ::core::default::Default::default();
988 ::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
989 self.external_locations.push(elem);
990 }
991 2u32 => {
992 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
993 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
994 field_number: 2u32,
995 expected: 2u8,
996 actual: tag.wire_type() as u8,
997 });
998 }
999 ::buffa::types::merge_string(
1000 self
1001 .next_page_token
1002 .get_or_insert_with(::buffa::alloc::string::String::new),
1003 buf,
1004 )?;
1005 }
1006 _ => {
1007 self.__buffa_unknown_fields
1008 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1009 }
1010 }
1011 ::core::result::Result::Ok(())
1012 }
1013 fn clear(&mut self) {
1014 self.external_locations.clear();
1015 self.next_page_token = ::core::option::Option::None;
1016 self.__buffa_unknown_fields.clear();
1017 }
1018}
1019impl ::buffa::ExtensionSet for ListExternalLocationsResponse {
1020 const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.ListExternalLocationsResponse";
1021 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1022 &self.__buffa_unknown_fields
1023 }
1024 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1025 &mut self.__buffa_unknown_fields
1026 }
1027}
1028impl ::buffa::json_helpers::ProtoElemJson for ListExternalLocationsResponse {
1029 fn serialize_proto_json<S: ::serde::Serializer>(
1030 v: &Self,
1031 s: S,
1032 ) -> ::core::result::Result<S::Ok, S::Error> {
1033 ::serde::Serialize::serialize(v, s)
1034 }
1035 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1036 d: D,
1037 ) -> ::core::result::Result<Self, D::Error> {
1038 <Self as ::serde::Deserialize>::deserialize(d)
1039 }
1040}
1041#[doc(hidden)]
1042pub const __LIST_EXTERNAL_LOCATIONS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1043 type_url: "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsResponse",
1044 to_json: ::buffa::type_registry::any_to_json::<ListExternalLocationsResponse>,
1045 from_json: ::buffa::type_registry::any_from_json::<ListExternalLocationsResponse>,
1046 is_wkt: false,
1047};
1048#[derive(Clone, PartialEq, Default)]
1050#[derive(::serde::Serialize, ::serde::Deserialize)]
1051#[serde(default)]
1052pub struct CreateExternalLocationRequest {
1053 #[serde(
1057 rename = "name",
1058 with = "::buffa::json_helpers::proto_string",
1059 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1060 )]
1061 pub name: ::buffa::alloc::string::String,
1062 #[serde(
1066 rename = "url",
1067 with = "::buffa::json_helpers::proto_string",
1068 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1069 )]
1070 pub url: ::buffa::alloc::string::String,
1071 #[serde(
1075 rename = "credential_name",
1076 alias = "credentialName",
1077 with = "::buffa::json_helpers::proto_string",
1078 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1079 )]
1080 pub credential_name: ::buffa::alloc::string::String,
1081 #[serde(
1085 rename = "read_only",
1086 alias = "readOnly",
1087 skip_serializing_if = "::core::option::Option::is_none"
1088 )]
1089 pub read_only: ::core::option::Option<bool>,
1090 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
1094 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
1095 #[serde(
1099 rename = "skip_validation",
1100 alias = "skipValidation",
1101 skip_serializing_if = "::core::option::Option::is_none"
1102 )]
1103 pub skip_validation: ::core::option::Option<bool>,
1104 #[serde(skip)]
1105 #[doc(hidden)]
1106 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1107}
1108impl ::core::fmt::Debug for CreateExternalLocationRequest {
1109 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1110 f.debug_struct("CreateExternalLocationRequest")
1111 .field("name", &self.name)
1112 .field("url", &self.url)
1113 .field("credential_name", &self.credential_name)
1114 .field("read_only", &self.read_only)
1115 .field("comment", &self.comment)
1116 .field("skip_validation", &self.skip_validation)
1117 .finish()
1118 }
1119}
1120impl CreateExternalLocationRequest {
1121 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.CreateExternalLocationRequest";
1126}
1127impl CreateExternalLocationRequest {
1128 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1129 #[inline]
1130 pub fn with_read_only(mut self, value: bool) -> Self {
1132 self.read_only = Some(value);
1133 self
1134 }
1135 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1136 #[inline]
1137 pub fn with_comment(
1139 mut self,
1140 value: impl Into<::buffa::alloc::string::String>,
1141 ) -> Self {
1142 self.comment = Some(value.into());
1143 self
1144 }
1145 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1146 #[inline]
1147 pub fn with_skip_validation(mut self, value: bool) -> Self {
1149 self.skip_validation = Some(value);
1150 self
1151 }
1152}
1153impl ::buffa::DefaultInstance for CreateExternalLocationRequest {
1154 fn default_instance() -> &'static Self {
1155 static VALUE: ::buffa::__private::OnceBox<CreateExternalLocationRequest> = ::buffa::__private::OnceBox::new();
1156 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1157 }
1158}
1159impl ::buffa::MessageName for CreateExternalLocationRequest {
1160 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
1161 const NAME: &'static str = "CreateExternalLocationRequest";
1162 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.CreateExternalLocationRequest";
1163 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.CreateExternalLocationRequest";
1164}
1165impl ::buffa::Message for CreateExternalLocationRequest {
1166 #[allow(clippy::let_and_return)]
1172 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1173 #[allow(unused_imports)]
1174 use ::buffa::Enumeration as _;
1175 let mut size = 0u32;
1176 if !self.name.is_empty() {
1177 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
1178 }
1179 if !self.url.is_empty() {
1180 size += 1u32 + ::buffa::types::string_encoded_len(&self.url) as u32;
1181 }
1182 if !self.credential_name.is_empty() {
1183 size
1184 += 1u32
1185 + ::buffa::types::string_encoded_len(&self.credential_name) as u32;
1186 }
1187 if self.read_only.is_some() {
1188 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1189 }
1190 if let Some(ref v) = self.comment {
1191 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1192 }
1193 if self.skip_validation.is_some() {
1194 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1195 }
1196 size += self.__buffa_unknown_fields.encoded_len() as u32;
1197 size
1198 }
1199 fn write_to(
1200 &self,
1201 _cache: &mut ::buffa::SizeCache,
1202 buf: &mut impl ::buffa::bytes::BufMut,
1203 ) {
1204 #[allow(unused_imports)]
1205 use ::buffa::Enumeration as _;
1206 if !self.name.is_empty() {
1207 ::buffa::encoding::Tag::new(
1208 1u32,
1209 ::buffa::encoding::WireType::LengthDelimited,
1210 )
1211 .encode(buf);
1212 ::buffa::types::encode_string(&self.name, buf);
1213 }
1214 if !self.url.is_empty() {
1215 ::buffa::encoding::Tag::new(
1216 2u32,
1217 ::buffa::encoding::WireType::LengthDelimited,
1218 )
1219 .encode(buf);
1220 ::buffa::types::encode_string(&self.url, buf);
1221 }
1222 if !self.credential_name.is_empty() {
1223 ::buffa::encoding::Tag::new(
1224 3u32,
1225 ::buffa::encoding::WireType::LengthDelimited,
1226 )
1227 .encode(buf);
1228 ::buffa::types::encode_string(&self.credential_name, buf);
1229 }
1230 if let Some(v) = self.read_only {
1231 ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
1232 .encode(buf);
1233 ::buffa::types::encode_bool(v, buf);
1234 }
1235 if let Some(ref v) = self.comment {
1236 ::buffa::encoding::Tag::new(
1237 5u32,
1238 ::buffa::encoding::WireType::LengthDelimited,
1239 )
1240 .encode(buf);
1241 ::buffa::types::encode_string(v, buf);
1242 }
1243 if let Some(v) = self.skip_validation {
1244 ::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
1245 .encode(buf);
1246 ::buffa::types::encode_bool(v, buf);
1247 }
1248 self.__buffa_unknown_fields.write_to(buf);
1249 }
1250 fn merge_field(
1251 &mut self,
1252 tag: ::buffa::encoding::Tag,
1253 buf: &mut impl ::buffa::bytes::Buf,
1254 depth: u32,
1255 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1256 #[allow(unused_imports)]
1257 use ::buffa::bytes::Buf as _;
1258 #[allow(unused_imports)]
1259 use ::buffa::Enumeration as _;
1260 match tag.field_number() {
1261 1u32 => {
1262 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1263 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1264 field_number: 1u32,
1265 expected: 2u8,
1266 actual: tag.wire_type() as u8,
1267 });
1268 }
1269 ::buffa::types::merge_string(&mut self.name, buf)?;
1270 }
1271 2u32 => {
1272 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1273 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1274 field_number: 2u32,
1275 expected: 2u8,
1276 actual: tag.wire_type() as u8,
1277 });
1278 }
1279 ::buffa::types::merge_string(&mut self.url, buf)?;
1280 }
1281 3u32 => {
1282 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1283 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1284 field_number: 3u32,
1285 expected: 2u8,
1286 actual: tag.wire_type() as u8,
1287 });
1288 }
1289 ::buffa::types::merge_string(&mut self.credential_name, buf)?;
1290 }
1291 4u32 => {
1292 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1293 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1294 field_number: 4u32,
1295 expected: 0u8,
1296 actual: tag.wire_type() as u8,
1297 });
1298 }
1299 self.read_only = ::core::option::Option::Some(
1300 ::buffa::types::decode_bool(buf)?,
1301 );
1302 }
1303 5u32 => {
1304 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1305 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1306 field_number: 5u32,
1307 expected: 2u8,
1308 actual: tag.wire_type() as u8,
1309 });
1310 }
1311 ::buffa::types::merge_string(
1312 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
1313 buf,
1314 )?;
1315 }
1316 6u32 => {
1317 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1318 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1319 field_number: 6u32,
1320 expected: 0u8,
1321 actual: tag.wire_type() as u8,
1322 });
1323 }
1324 self.skip_validation = ::core::option::Option::Some(
1325 ::buffa::types::decode_bool(buf)?,
1326 );
1327 }
1328 _ => {
1329 self.__buffa_unknown_fields
1330 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1331 }
1332 }
1333 ::core::result::Result::Ok(())
1334 }
1335 fn clear(&mut self) {
1336 self.name.clear();
1337 self.url.clear();
1338 self.credential_name.clear();
1339 self.read_only = ::core::option::Option::None;
1340 self.comment = ::core::option::Option::None;
1341 self.skip_validation = ::core::option::Option::None;
1342 self.__buffa_unknown_fields.clear();
1343 }
1344}
1345impl ::buffa::ExtensionSet for CreateExternalLocationRequest {
1346 const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.CreateExternalLocationRequest";
1347 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1348 &self.__buffa_unknown_fields
1349 }
1350 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1351 &mut self.__buffa_unknown_fields
1352 }
1353}
1354impl ::buffa::json_helpers::ProtoElemJson for CreateExternalLocationRequest {
1355 fn serialize_proto_json<S: ::serde::Serializer>(
1356 v: &Self,
1357 s: S,
1358 ) -> ::core::result::Result<S::Ok, S::Error> {
1359 ::serde::Serialize::serialize(v, s)
1360 }
1361 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1362 d: D,
1363 ) -> ::core::result::Result<Self, D::Error> {
1364 <Self as ::serde::Deserialize>::deserialize(d)
1365 }
1366}
1367#[doc(hidden)]
1368pub const __CREATE_EXTERNAL_LOCATION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1369 type_url: "type.googleapis.com/unitycatalog.external_locations.v1.CreateExternalLocationRequest",
1370 to_json: ::buffa::type_registry::any_to_json::<CreateExternalLocationRequest>,
1371 from_json: ::buffa::type_registry::any_from_json::<CreateExternalLocationRequest>,
1372 is_wkt: false,
1373};
1374#[derive(Clone, PartialEq, Default)]
1376#[derive(::serde::Serialize, ::serde::Deserialize)]
1377#[serde(default)]
1378pub struct GetExternalLocationRequest {
1379 #[serde(
1383 rename = "name",
1384 with = "::buffa::json_helpers::proto_string",
1385 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1386 )]
1387 pub name: ::buffa::alloc::string::String,
1388 #[serde(skip)]
1389 #[doc(hidden)]
1390 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1391}
1392impl ::core::fmt::Debug for GetExternalLocationRequest {
1393 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1394 f.debug_struct("GetExternalLocationRequest").field("name", &self.name).finish()
1395 }
1396}
1397impl GetExternalLocationRequest {
1398 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.GetExternalLocationRequest";
1403}
1404impl ::buffa::DefaultInstance for GetExternalLocationRequest {
1405 fn default_instance() -> &'static Self {
1406 static VALUE: ::buffa::__private::OnceBox<GetExternalLocationRequest> = ::buffa::__private::OnceBox::new();
1407 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1408 }
1409}
1410impl ::buffa::MessageName for GetExternalLocationRequest {
1411 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
1412 const NAME: &'static str = "GetExternalLocationRequest";
1413 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.GetExternalLocationRequest";
1414 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.GetExternalLocationRequest";
1415}
1416impl ::buffa::Message for GetExternalLocationRequest {
1417 #[allow(clippy::let_and_return)]
1423 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1424 #[allow(unused_imports)]
1425 use ::buffa::Enumeration as _;
1426 let mut size = 0u32;
1427 if !self.name.is_empty() {
1428 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) 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 if !self.name.is_empty() {
1441 ::buffa::encoding::Tag::new(
1442 1u32,
1443 ::buffa::encoding::WireType::LengthDelimited,
1444 )
1445 .encode(buf);
1446 ::buffa::types::encode_string(&self.name, buf);
1447 }
1448 self.__buffa_unknown_fields.write_to(buf);
1449 }
1450 fn merge_field(
1451 &mut self,
1452 tag: ::buffa::encoding::Tag,
1453 buf: &mut impl ::buffa::bytes::Buf,
1454 depth: u32,
1455 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1456 #[allow(unused_imports)]
1457 use ::buffa::bytes::Buf as _;
1458 #[allow(unused_imports)]
1459 use ::buffa::Enumeration as _;
1460 match tag.field_number() {
1461 1u32 => {
1462 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1463 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1464 field_number: 1u32,
1465 expected: 2u8,
1466 actual: tag.wire_type() as u8,
1467 });
1468 }
1469 ::buffa::types::merge_string(&mut self.name, buf)?;
1470 }
1471 _ => {
1472 self.__buffa_unknown_fields
1473 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1474 }
1475 }
1476 ::core::result::Result::Ok(())
1477 }
1478 fn clear(&mut self) {
1479 self.name.clear();
1480 self.__buffa_unknown_fields.clear();
1481 }
1482}
1483impl ::buffa::ExtensionSet for GetExternalLocationRequest {
1484 const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.GetExternalLocationRequest";
1485 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1486 &self.__buffa_unknown_fields
1487 }
1488 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1489 &mut self.__buffa_unknown_fields
1490 }
1491}
1492impl ::buffa::json_helpers::ProtoElemJson for GetExternalLocationRequest {
1493 fn serialize_proto_json<S: ::serde::Serializer>(
1494 v: &Self,
1495 s: S,
1496 ) -> ::core::result::Result<S::Ok, S::Error> {
1497 ::serde::Serialize::serialize(v, s)
1498 }
1499 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1500 d: D,
1501 ) -> ::core::result::Result<Self, D::Error> {
1502 <Self as ::serde::Deserialize>::deserialize(d)
1503 }
1504}
1505#[doc(hidden)]
1506pub const __GET_EXTERNAL_LOCATION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1507 type_url: "type.googleapis.com/unitycatalog.external_locations.v1.GetExternalLocationRequest",
1508 to_json: ::buffa::type_registry::any_to_json::<GetExternalLocationRequest>,
1509 from_json: ::buffa::type_registry::any_from_json::<GetExternalLocationRequest>,
1510 is_wkt: false,
1511};
1512#[derive(Clone, PartialEq, Default)]
1514#[derive(::serde::Serialize, ::serde::Deserialize)]
1515#[serde(default)]
1516pub struct UpdateExternalLocationRequest {
1517 #[serde(
1521 rename = "name",
1522 with = "::buffa::json_helpers::proto_string",
1523 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1524 )]
1525 pub name: ::buffa::alloc::string::String,
1526 #[serde(rename = "url", skip_serializing_if = "::core::option::Option::is_none")]
1530 pub url: ::core::option::Option<::buffa::alloc::string::String>,
1531 #[serde(
1535 rename = "credential_name",
1536 alias = "credentialName",
1537 skip_serializing_if = "::core::option::Option::is_none"
1538 )]
1539 pub credential_name: ::core::option::Option<::buffa::alloc::string::String>,
1540 #[serde(
1544 rename = "read_only",
1545 alias = "readOnly",
1546 skip_serializing_if = "::core::option::Option::is_none"
1547 )]
1548 pub read_only: ::core::option::Option<bool>,
1549 #[serde(rename = "owner", skip_serializing_if = "::core::option::Option::is_none")]
1553 pub owner: ::core::option::Option<::buffa::alloc::string::String>,
1554 #[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
1558 pub comment: ::core::option::Option<::buffa::alloc::string::String>,
1559 #[serde(
1563 rename = "new_name",
1564 alias = "newName",
1565 skip_serializing_if = "::core::option::Option::is_none"
1566 )]
1567 pub new_name: ::core::option::Option<::buffa::alloc::string::String>,
1568 #[serde(rename = "force", skip_serializing_if = "::core::option::Option::is_none")]
1572 pub force: ::core::option::Option<bool>,
1573 #[serde(
1577 rename = "skip_validation",
1578 alias = "skipValidation",
1579 skip_serializing_if = "::core::option::Option::is_none"
1580 )]
1581 pub skip_validation: ::core::option::Option<bool>,
1582 #[serde(skip)]
1583 #[doc(hidden)]
1584 pub __buffa_unknown_fields: ::buffa::UnknownFields,
1585}
1586impl ::core::fmt::Debug for UpdateExternalLocationRequest {
1587 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1588 f.debug_struct("UpdateExternalLocationRequest")
1589 .field("name", &self.name)
1590 .field("url", &self.url)
1591 .field("credential_name", &self.credential_name)
1592 .field("read_only", &self.read_only)
1593 .field("owner", &self.owner)
1594 .field("comment", &self.comment)
1595 .field("new_name", &self.new_name)
1596 .field("force", &self.force)
1597 .field("skip_validation", &self.skip_validation)
1598 .finish()
1599 }
1600}
1601impl UpdateExternalLocationRequest {
1602 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.UpdateExternalLocationRequest";
1607}
1608impl UpdateExternalLocationRequest {
1609 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1610 #[inline]
1611 pub fn with_url(mut self, value: impl Into<::buffa::alloc::string::String>) -> Self {
1613 self.url = Some(value.into());
1614 self
1615 }
1616 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1617 #[inline]
1618 pub fn with_credential_name(
1620 mut self,
1621 value: impl Into<::buffa::alloc::string::String>,
1622 ) -> Self {
1623 self.credential_name = Some(value.into());
1624 self
1625 }
1626 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1627 #[inline]
1628 pub fn with_read_only(mut self, value: bool) -> Self {
1630 self.read_only = Some(value);
1631 self
1632 }
1633 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1634 #[inline]
1635 pub fn with_owner(
1637 mut self,
1638 value: impl Into<::buffa::alloc::string::String>,
1639 ) -> Self {
1640 self.owner = Some(value.into());
1641 self
1642 }
1643 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1644 #[inline]
1645 pub fn with_comment(
1647 mut self,
1648 value: impl Into<::buffa::alloc::string::String>,
1649 ) -> Self {
1650 self.comment = Some(value.into());
1651 self
1652 }
1653 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1654 #[inline]
1655 pub fn with_new_name(
1657 mut self,
1658 value: impl Into<::buffa::alloc::string::String>,
1659 ) -> Self {
1660 self.new_name = Some(value.into());
1661 self
1662 }
1663 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1664 #[inline]
1665 pub fn with_force(mut self, value: bool) -> Self {
1667 self.force = Some(value);
1668 self
1669 }
1670 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
1671 #[inline]
1672 pub fn with_skip_validation(mut self, value: bool) -> Self {
1674 self.skip_validation = Some(value);
1675 self
1676 }
1677}
1678impl ::buffa::DefaultInstance for UpdateExternalLocationRequest {
1679 fn default_instance() -> &'static Self {
1680 static VALUE: ::buffa::__private::OnceBox<UpdateExternalLocationRequest> = ::buffa::__private::OnceBox::new();
1681 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
1682 }
1683}
1684impl ::buffa::MessageName for UpdateExternalLocationRequest {
1685 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
1686 const NAME: &'static str = "UpdateExternalLocationRequest";
1687 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.UpdateExternalLocationRequest";
1688 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.UpdateExternalLocationRequest";
1689}
1690impl ::buffa::Message for UpdateExternalLocationRequest {
1691 #[allow(clippy::let_and_return)]
1697 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
1698 #[allow(unused_imports)]
1699 use ::buffa::Enumeration as _;
1700 let mut size = 0u32;
1701 if !self.name.is_empty() {
1702 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
1703 }
1704 if let Some(ref v) = self.url {
1705 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1706 }
1707 if let Some(ref v) = self.credential_name {
1708 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1709 }
1710 if self.read_only.is_some() {
1711 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1712 }
1713 if let Some(ref v) = self.owner {
1714 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1715 }
1716 if let Some(ref v) = self.comment {
1717 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1718 }
1719 if let Some(ref v) = self.new_name {
1720 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
1721 }
1722 if self.force.is_some() {
1723 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1724 }
1725 if self.skip_validation.is_some() {
1726 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
1727 }
1728 size += self.__buffa_unknown_fields.encoded_len() as u32;
1729 size
1730 }
1731 fn write_to(
1732 &self,
1733 _cache: &mut ::buffa::SizeCache,
1734 buf: &mut impl ::buffa::bytes::BufMut,
1735 ) {
1736 #[allow(unused_imports)]
1737 use ::buffa::Enumeration as _;
1738 if !self.name.is_empty() {
1739 ::buffa::encoding::Tag::new(
1740 1u32,
1741 ::buffa::encoding::WireType::LengthDelimited,
1742 )
1743 .encode(buf);
1744 ::buffa::types::encode_string(&self.name, buf);
1745 }
1746 if let Some(ref v) = self.url {
1747 ::buffa::encoding::Tag::new(
1748 2u32,
1749 ::buffa::encoding::WireType::LengthDelimited,
1750 )
1751 .encode(buf);
1752 ::buffa::types::encode_string(v, buf);
1753 }
1754 if let Some(ref v) = self.credential_name {
1755 ::buffa::encoding::Tag::new(
1756 3u32,
1757 ::buffa::encoding::WireType::LengthDelimited,
1758 )
1759 .encode(buf);
1760 ::buffa::types::encode_string(v, buf);
1761 }
1762 if let Some(v) = self.read_only {
1763 ::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
1764 .encode(buf);
1765 ::buffa::types::encode_bool(v, buf);
1766 }
1767 if let Some(ref v) = self.owner {
1768 ::buffa::encoding::Tag::new(
1769 5u32,
1770 ::buffa::encoding::WireType::LengthDelimited,
1771 )
1772 .encode(buf);
1773 ::buffa::types::encode_string(v, buf);
1774 }
1775 if let Some(ref v) = self.comment {
1776 ::buffa::encoding::Tag::new(
1777 6u32,
1778 ::buffa::encoding::WireType::LengthDelimited,
1779 )
1780 .encode(buf);
1781 ::buffa::types::encode_string(v, buf);
1782 }
1783 if let Some(ref v) = self.new_name {
1784 ::buffa::encoding::Tag::new(
1785 7u32,
1786 ::buffa::encoding::WireType::LengthDelimited,
1787 )
1788 .encode(buf);
1789 ::buffa::types::encode_string(v, buf);
1790 }
1791 if let Some(v) = self.force {
1792 ::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Varint)
1793 .encode(buf);
1794 ::buffa::types::encode_bool(v, buf);
1795 }
1796 if let Some(v) = self.skip_validation {
1797 ::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
1798 .encode(buf);
1799 ::buffa::types::encode_bool(v, buf);
1800 }
1801 self.__buffa_unknown_fields.write_to(buf);
1802 }
1803 fn merge_field(
1804 &mut self,
1805 tag: ::buffa::encoding::Tag,
1806 buf: &mut impl ::buffa::bytes::Buf,
1807 depth: u32,
1808 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
1809 #[allow(unused_imports)]
1810 use ::buffa::bytes::Buf as _;
1811 #[allow(unused_imports)]
1812 use ::buffa::Enumeration as _;
1813 match tag.field_number() {
1814 1u32 => {
1815 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1816 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1817 field_number: 1u32,
1818 expected: 2u8,
1819 actual: tag.wire_type() as u8,
1820 });
1821 }
1822 ::buffa::types::merge_string(&mut self.name, buf)?;
1823 }
1824 2u32 => {
1825 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1826 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1827 field_number: 2u32,
1828 expected: 2u8,
1829 actual: tag.wire_type() as u8,
1830 });
1831 }
1832 ::buffa::types::merge_string(
1833 self.url.get_or_insert_with(::buffa::alloc::string::String::new),
1834 buf,
1835 )?;
1836 }
1837 3u32 => {
1838 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1839 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1840 field_number: 3u32,
1841 expected: 2u8,
1842 actual: tag.wire_type() as u8,
1843 });
1844 }
1845 ::buffa::types::merge_string(
1846 self
1847 .credential_name
1848 .get_or_insert_with(::buffa::alloc::string::String::new),
1849 buf,
1850 )?;
1851 }
1852 4u32 => {
1853 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1854 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1855 field_number: 4u32,
1856 expected: 0u8,
1857 actual: tag.wire_type() as u8,
1858 });
1859 }
1860 self.read_only = ::core::option::Option::Some(
1861 ::buffa::types::decode_bool(buf)?,
1862 );
1863 }
1864 5u32 => {
1865 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1866 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1867 field_number: 5u32,
1868 expected: 2u8,
1869 actual: tag.wire_type() as u8,
1870 });
1871 }
1872 ::buffa::types::merge_string(
1873 self.owner.get_or_insert_with(::buffa::alloc::string::String::new),
1874 buf,
1875 )?;
1876 }
1877 6u32 => {
1878 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1879 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1880 field_number: 6u32,
1881 expected: 2u8,
1882 actual: tag.wire_type() as u8,
1883 });
1884 }
1885 ::buffa::types::merge_string(
1886 self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
1887 buf,
1888 )?;
1889 }
1890 7u32 => {
1891 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
1892 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1893 field_number: 7u32,
1894 expected: 2u8,
1895 actual: tag.wire_type() as u8,
1896 });
1897 }
1898 ::buffa::types::merge_string(
1899 self
1900 .new_name
1901 .get_or_insert_with(::buffa::alloc::string::String::new),
1902 buf,
1903 )?;
1904 }
1905 8u32 => {
1906 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1907 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1908 field_number: 8u32,
1909 expected: 0u8,
1910 actual: tag.wire_type() as u8,
1911 });
1912 }
1913 self.force = ::core::option::Option::Some(
1914 ::buffa::types::decode_bool(buf)?,
1915 );
1916 }
1917 9u32 => {
1918 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
1919 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
1920 field_number: 9u32,
1921 expected: 0u8,
1922 actual: tag.wire_type() as u8,
1923 });
1924 }
1925 self.skip_validation = ::core::option::Option::Some(
1926 ::buffa::types::decode_bool(buf)?,
1927 );
1928 }
1929 _ => {
1930 self.__buffa_unknown_fields
1931 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
1932 }
1933 }
1934 ::core::result::Result::Ok(())
1935 }
1936 fn clear(&mut self) {
1937 self.name.clear();
1938 self.url = ::core::option::Option::None;
1939 self.credential_name = ::core::option::Option::None;
1940 self.read_only = ::core::option::Option::None;
1941 self.owner = ::core::option::Option::None;
1942 self.comment = ::core::option::Option::None;
1943 self.new_name = ::core::option::Option::None;
1944 self.force = ::core::option::Option::None;
1945 self.skip_validation = ::core::option::Option::None;
1946 self.__buffa_unknown_fields.clear();
1947 }
1948}
1949impl ::buffa::ExtensionSet for UpdateExternalLocationRequest {
1950 const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.UpdateExternalLocationRequest";
1951 fn unknown_fields(&self) -> &::buffa::UnknownFields {
1952 &self.__buffa_unknown_fields
1953 }
1954 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
1955 &mut self.__buffa_unknown_fields
1956 }
1957}
1958impl ::buffa::json_helpers::ProtoElemJson for UpdateExternalLocationRequest {
1959 fn serialize_proto_json<S: ::serde::Serializer>(
1960 v: &Self,
1961 s: S,
1962 ) -> ::core::result::Result<S::Ok, S::Error> {
1963 ::serde::Serialize::serialize(v, s)
1964 }
1965 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
1966 d: D,
1967 ) -> ::core::result::Result<Self, D::Error> {
1968 <Self as ::serde::Deserialize>::deserialize(d)
1969 }
1970}
1971#[doc(hidden)]
1972pub const __UPDATE_EXTERNAL_LOCATION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
1973 type_url: "type.googleapis.com/unitycatalog.external_locations.v1.UpdateExternalLocationRequest",
1974 to_json: ::buffa::type_registry::any_to_json::<UpdateExternalLocationRequest>,
1975 from_json: ::buffa::type_registry::any_from_json::<UpdateExternalLocationRequest>,
1976 is_wkt: false,
1977};
1978#[derive(Clone, PartialEq, Default)]
1980#[derive(::serde::Serialize, ::serde::Deserialize)]
1981#[serde(default)]
1982pub struct DeleteExternalLocationRequest {
1983 #[serde(
1987 rename = "name",
1988 with = "::buffa::json_helpers::proto_string",
1989 skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
1990 )]
1991 pub name: ::buffa::alloc::string::String,
1992 #[serde(rename = "force", skip_serializing_if = "::core::option::Option::is_none")]
1996 pub force: ::core::option::Option<bool>,
1997 #[serde(skip)]
1998 #[doc(hidden)]
1999 pub __buffa_unknown_fields: ::buffa::UnknownFields,
2000}
2001impl ::core::fmt::Debug for DeleteExternalLocationRequest {
2002 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2003 f.debug_struct("DeleteExternalLocationRequest")
2004 .field("name", &self.name)
2005 .field("force", &self.force)
2006 .finish()
2007 }
2008}
2009impl DeleteExternalLocationRequest {
2010 pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.DeleteExternalLocationRequest";
2015}
2016impl DeleteExternalLocationRequest {
2017 #[must_use = "with_* setters return `self` by value; assign or chain the result"]
2018 #[inline]
2019 pub fn with_force(mut self, value: bool) -> Self {
2021 self.force = Some(value);
2022 self
2023 }
2024}
2025impl ::buffa::DefaultInstance for DeleteExternalLocationRequest {
2026 fn default_instance() -> &'static Self {
2027 static VALUE: ::buffa::__private::OnceBox<DeleteExternalLocationRequest> = ::buffa::__private::OnceBox::new();
2028 VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
2029 }
2030}
2031impl ::buffa::MessageName for DeleteExternalLocationRequest {
2032 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
2033 const NAME: &'static str = "DeleteExternalLocationRequest";
2034 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.DeleteExternalLocationRequest";
2035 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.DeleteExternalLocationRequest";
2036}
2037impl ::buffa::Message for DeleteExternalLocationRequest {
2038 #[allow(clippy::let_and_return)]
2044 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2045 #[allow(unused_imports)]
2046 use ::buffa::Enumeration as _;
2047 let mut size = 0u32;
2048 if !self.name.is_empty() {
2049 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
2050 }
2051 if self.force.is_some() {
2052 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
2053 }
2054 size += self.__buffa_unknown_fields.encoded_len() as u32;
2055 size
2056 }
2057 fn write_to(
2058 &self,
2059 _cache: &mut ::buffa::SizeCache,
2060 buf: &mut impl ::buffa::bytes::BufMut,
2061 ) {
2062 #[allow(unused_imports)]
2063 use ::buffa::Enumeration as _;
2064 if !self.name.is_empty() {
2065 ::buffa::encoding::Tag::new(
2066 1u32,
2067 ::buffa::encoding::WireType::LengthDelimited,
2068 )
2069 .encode(buf);
2070 ::buffa::types::encode_string(&self.name, buf);
2071 }
2072 if let Some(v) = self.force {
2073 ::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
2074 .encode(buf);
2075 ::buffa::types::encode_bool(v, buf);
2076 }
2077 self.__buffa_unknown_fields.write_to(buf);
2078 }
2079 fn merge_field(
2080 &mut self,
2081 tag: ::buffa::encoding::Tag,
2082 buf: &mut impl ::buffa::bytes::Buf,
2083 depth: u32,
2084 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2085 #[allow(unused_imports)]
2086 use ::buffa::bytes::Buf as _;
2087 #[allow(unused_imports)]
2088 use ::buffa::Enumeration as _;
2089 match tag.field_number() {
2090 1u32 => {
2091 if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
2092 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2093 field_number: 1u32,
2094 expected: 2u8,
2095 actual: tag.wire_type() as u8,
2096 });
2097 }
2098 ::buffa::types::merge_string(&mut self.name, buf)?;
2099 }
2100 2u32 => {
2101 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2102 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2103 field_number: 2u32,
2104 expected: 0u8,
2105 actual: tag.wire_type() as u8,
2106 });
2107 }
2108 self.force = ::core::option::Option::Some(
2109 ::buffa::types::decode_bool(buf)?,
2110 );
2111 }
2112 _ => {
2113 self.__buffa_unknown_fields
2114 .push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
2115 }
2116 }
2117 ::core::result::Result::Ok(())
2118 }
2119 fn clear(&mut self) {
2120 self.name.clear();
2121 self.force = ::core::option::Option::None;
2122 self.__buffa_unknown_fields.clear();
2123 }
2124}
2125impl ::buffa::ExtensionSet for DeleteExternalLocationRequest {
2126 const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.DeleteExternalLocationRequest";
2127 fn unknown_fields(&self) -> &::buffa::UnknownFields {
2128 &self.__buffa_unknown_fields
2129 }
2130 fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
2131 &mut self.__buffa_unknown_fields
2132 }
2133}
2134impl ::buffa::json_helpers::ProtoElemJson for DeleteExternalLocationRequest {
2135 fn serialize_proto_json<S: ::serde::Serializer>(
2136 v: &Self,
2137 s: S,
2138 ) -> ::core::result::Result<S::Ok, S::Error> {
2139 ::serde::Serialize::serialize(v, s)
2140 }
2141 fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
2142 d: D,
2143 ) -> ::core::result::Result<Self, D::Error> {
2144 <Self as ::serde::Deserialize>::deserialize(d)
2145 }
2146}
2147#[doc(hidden)]
2148pub const __DELETE_EXTERNAL_LOCATION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
2149 type_url: "type.googleapis.com/unitycatalog.external_locations.v1.DeleteExternalLocationRequest",
2150 to_json: ::buffa::type_registry::any_to_json::<DeleteExternalLocationRequest>,
2151 from_json: ::buffa::type_registry::any_from_json::<DeleteExternalLocationRequest>,
2152 is_wkt: false,
2153};
2154#[allow(
2155 non_camel_case_types,
2156 dead_code,
2157 unused_imports,
2158 unused_qualifications,
2159 clippy::derivable_impls,
2160 clippy::match_single_binding,
2161 clippy::uninlined_format_args,
2162 clippy::doc_lazy_continuation,
2163 clippy::module_inception
2164)]
2165pub mod __buffa {
2166 #[allow(unused_imports)]
2167 use super::*;
2168 pub mod view {
2169 #[allow(unused_imports)]
2170 use super::*;
2171 #[derive(Clone, Debug, Default)]
2172 pub struct ExternalLocationView<'a> {
2173 pub name: &'a str,
2177 pub url: &'a str,
2181 pub credential_name: &'a str,
2185 pub read_only: bool,
2189 pub comment: ::core::option::Option<&'a str>,
2193 pub owner: ::core::option::Option<&'a str>,
2197 pub credential_id: &'a str,
2204 pub created_at: ::core::option::Option<i64>,
2208 pub created_by: ::core::option::Option<&'a str>,
2212 pub updated_at: ::core::option::Option<i64>,
2216 pub updated_by: ::core::option::Option<&'a str>,
2220 pub browse_only: ::core::option::Option<bool>,
2225 pub external_location_id: ::core::option::Option<&'a str>,
2227 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2228 }
2229 impl<'a> ExternalLocationView<'a> {
2230 #[doc(hidden)]
2238 pub fn _decode_depth(
2239 buf: &'a [u8],
2240 depth: u32,
2241 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2242 let mut view = Self::default();
2243 view._merge_into_view(buf, depth)?;
2244 ::core::result::Result::Ok(view)
2245 }
2246 #[doc(hidden)]
2254 pub fn _merge_into_view(
2255 &mut self,
2256 buf: &'a [u8],
2257 depth: u32,
2258 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
2259 let _ = depth;
2260 #[allow(unused_variables)]
2261 let view = self;
2262 let mut cur: &'a [u8] = buf;
2263 while !cur.is_empty() {
2264 let before_tag = cur;
2265 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
2266 match tag.field_number() {
2267 1u32 => {
2268 if tag.wire_type()
2269 != ::buffa::encoding::WireType::LengthDelimited
2270 {
2271 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2272 field_number: 1u32,
2273 expected: 2u8,
2274 actual: tag.wire_type() as u8,
2275 });
2276 }
2277 view.name = ::buffa::types::borrow_str(&mut cur)?;
2278 }
2279 2u32 => {
2280 if tag.wire_type()
2281 != ::buffa::encoding::WireType::LengthDelimited
2282 {
2283 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2284 field_number: 2u32,
2285 expected: 2u8,
2286 actual: tag.wire_type() as u8,
2287 });
2288 }
2289 view.url = ::buffa::types::borrow_str(&mut cur)?;
2290 }
2291 3u32 => {
2292 if tag.wire_type()
2293 != ::buffa::encoding::WireType::LengthDelimited
2294 {
2295 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2296 field_number: 3u32,
2297 expected: 2u8,
2298 actual: tag.wire_type() as u8,
2299 });
2300 }
2301 view.credential_name = ::buffa::types::borrow_str(&mut cur)?;
2302 }
2303 4u32 => {
2304 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2305 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2306 field_number: 4u32,
2307 expected: 0u8,
2308 actual: tag.wire_type() as u8,
2309 });
2310 }
2311 view.read_only = ::buffa::types::decode_bool(&mut cur)?;
2312 }
2313 5u32 => {
2314 if tag.wire_type()
2315 != ::buffa::encoding::WireType::LengthDelimited
2316 {
2317 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2318 field_number: 5u32,
2319 expected: 2u8,
2320 actual: tag.wire_type() as u8,
2321 });
2322 }
2323 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
2324 }
2325 6u32 => {
2326 if tag.wire_type()
2327 != ::buffa::encoding::WireType::LengthDelimited
2328 {
2329 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2330 field_number: 6u32,
2331 expected: 2u8,
2332 actual: tag.wire_type() as u8,
2333 });
2334 }
2335 view.owner = Some(::buffa::types::borrow_str(&mut cur)?);
2336 }
2337 8u32 => {
2338 if tag.wire_type()
2339 != ::buffa::encoding::WireType::LengthDelimited
2340 {
2341 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2342 field_number: 8u32,
2343 expected: 2u8,
2344 actual: tag.wire_type() as u8,
2345 });
2346 }
2347 view.credential_id = ::buffa::types::borrow_str(&mut cur)?;
2348 }
2349 9u32 => {
2350 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2351 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2352 field_number: 9u32,
2353 expected: 0u8,
2354 actual: tag.wire_type() as u8,
2355 });
2356 }
2357 view.created_at = Some(
2358 ::buffa::types::decode_int64(&mut cur)?,
2359 );
2360 }
2361 10u32 => {
2362 if tag.wire_type()
2363 != ::buffa::encoding::WireType::LengthDelimited
2364 {
2365 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2366 field_number: 10u32,
2367 expected: 2u8,
2368 actual: tag.wire_type() as u8,
2369 });
2370 }
2371 view.created_by = Some(
2372 ::buffa::types::borrow_str(&mut cur)?,
2373 );
2374 }
2375 11u32 => {
2376 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2377 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2378 field_number: 11u32,
2379 expected: 0u8,
2380 actual: tag.wire_type() as u8,
2381 });
2382 }
2383 view.updated_at = Some(
2384 ::buffa::types::decode_int64(&mut cur)?,
2385 );
2386 }
2387 12u32 => {
2388 if tag.wire_type()
2389 != ::buffa::encoding::WireType::LengthDelimited
2390 {
2391 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2392 field_number: 12u32,
2393 expected: 2u8,
2394 actual: tag.wire_type() as u8,
2395 });
2396 }
2397 view.updated_by = Some(
2398 ::buffa::types::borrow_str(&mut cur)?,
2399 );
2400 }
2401 13u32 => {
2402 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
2403 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2404 field_number: 13u32,
2405 expected: 0u8,
2406 actual: tag.wire_type() as u8,
2407 });
2408 }
2409 view.browse_only = Some(
2410 ::buffa::types::decode_bool(&mut cur)?,
2411 );
2412 }
2413 100u32 => {
2414 if tag.wire_type()
2415 != ::buffa::encoding::WireType::LengthDelimited
2416 {
2417 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
2418 field_number: 100u32,
2419 expected: 2u8,
2420 actual: tag.wire_type() as u8,
2421 });
2422 }
2423 view.external_location_id = Some(
2424 ::buffa::types::borrow_str(&mut cur)?,
2425 );
2426 }
2427 _ => {
2428 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
2429 let span_len = before_tag.len() - cur.len();
2430 view.__buffa_unknown_fields
2431 .push_raw(&before_tag[..span_len]);
2432 }
2433 }
2434 }
2435 ::core::result::Result::Ok(())
2436 }
2437 }
2438 impl<'a> ::buffa::MessageView<'a> for ExternalLocationView<'a> {
2439 type Owned = super::super::ExternalLocation;
2440 fn decode_view(
2441 buf: &'a [u8],
2442 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2443 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
2444 }
2445 fn decode_view_with_limit(
2446 buf: &'a [u8],
2447 depth: u32,
2448 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2449 Self::_decode_depth(buf, depth)
2450 }
2451 fn to_owned_message(&self) -> super::super::ExternalLocation {
2452 self.to_owned_from_source(None)
2453 }
2454 #[allow(clippy::useless_conversion, clippy::needless_update)]
2455 fn to_owned_from_source(
2456 &self,
2457 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
2458 ) -> super::super::ExternalLocation {
2459 #[allow(unused_imports)]
2460 use ::buffa::alloc::string::ToString as _;
2461 let _ = __buffa_src;
2462 super::super::ExternalLocation {
2463 name: self.name.to_string(),
2464 url: self.url.to_string(),
2465 credential_name: self.credential_name.to_string(),
2466 read_only: self.read_only,
2467 comment: self.comment.map(|s| s.to_string()),
2468 owner: self.owner.map(|s| s.to_string()),
2469 credential_id: self.credential_id.to_string(),
2470 created_at: self.created_at,
2471 created_by: self.created_by.map(|s| s.to_string()),
2472 updated_at: self.updated_at,
2473 updated_by: self.updated_by.map(|s| s.to_string()),
2474 browse_only: self.browse_only,
2475 external_location_id: self
2476 .external_location_id
2477 .map(|s| s.to_string()),
2478 __buffa_unknown_fields: self
2479 .__buffa_unknown_fields
2480 .to_owned()
2481 .unwrap_or_default()
2482 .into(),
2483 ..::core::default::Default::default()
2484 }
2485 }
2486 }
2487 impl<'a> ::buffa::ViewEncode<'a> for ExternalLocationView<'a> {
2488 #[allow(clippy::needless_borrow, clippy::let_and_return)]
2489 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
2490 #[allow(unused_imports)]
2491 use ::buffa::Enumeration as _;
2492 let mut size = 0u32;
2493 if !self.name.is_empty() {
2494 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
2495 }
2496 if !self.url.is_empty() {
2497 size += 1u32 + ::buffa::types::string_encoded_len(&self.url) as u32;
2498 }
2499 if !self.credential_name.is_empty() {
2500 size
2501 += 1u32
2502 + ::buffa::types::string_encoded_len(&self.credential_name)
2503 as u32;
2504 }
2505 if self.read_only {
2506 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
2507 }
2508 if let Some(ref v) = self.comment {
2509 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2510 }
2511 if let Some(ref v) = self.owner {
2512 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2513 }
2514 if !self.credential_id.is_empty() {
2515 size
2516 += 1u32
2517 + ::buffa::types::string_encoded_len(&self.credential_id)
2518 as u32;
2519 }
2520 if let Some(v) = self.created_at {
2521 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
2522 }
2523 if let Some(ref v) = self.created_by {
2524 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2525 }
2526 if let Some(v) = self.updated_at {
2527 size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
2528 }
2529 if let Some(ref v) = self.updated_by {
2530 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
2531 }
2532 if self.browse_only.is_some() {
2533 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
2534 }
2535 if let Some(ref v) = self.external_location_id {
2536 size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
2537 }
2538 size += self.__buffa_unknown_fields.encoded_len() as u32;
2539 size
2540 }
2541 #[allow(clippy::needless_borrow)]
2542 fn write_to(
2543 &self,
2544 _cache: &mut ::buffa::SizeCache,
2545 buf: &mut impl ::buffa::bytes::BufMut,
2546 ) {
2547 #[allow(unused_imports)]
2548 use ::buffa::Enumeration as _;
2549 if !self.name.is_empty() {
2550 ::buffa::encoding::Tag::new(
2551 1u32,
2552 ::buffa::encoding::WireType::LengthDelimited,
2553 )
2554 .encode(buf);
2555 ::buffa::types::encode_string(&self.name, buf);
2556 }
2557 if !self.url.is_empty() {
2558 ::buffa::encoding::Tag::new(
2559 2u32,
2560 ::buffa::encoding::WireType::LengthDelimited,
2561 )
2562 .encode(buf);
2563 ::buffa::types::encode_string(&self.url, buf);
2564 }
2565 if !self.credential_name.is_empty() {
2566 ::buffa::encoding::Tag::new(
2567 3u32,
2568 ::buffa::encoding::WireType::LengthDelimited,
2569 )
2570 .encode(buf);
2571 ::buffa::types::encode_string(&self.credential_name, buf);
2572 }
2573 if self.read_only {
2574 ::buffa::encoding::Tag::new(
2575 4u32,
2576 ::buffa::encoding::WireType::Varint,
2577 )
2578 .encode(buf);
2579 ::buffa::types::encode_bool(self.read_only, buf);
2580 }
2581 if let Some(ref v) = self.comment {
2582 ::buffa::encoding::Tag::new(
2583 5u32,
2584 ::buffa::encoding::WireType::LengthDelimited,
2585 )
2586 .encode(buf);
2587 ::buffa::types::encode_string(v, buf);
2588 }
2589 if let Some(ref v) = self.owner {
2590 ::buffa::encoding::Tag::new(
2591 6u32,
2592 ::buffa::encoding::WireType::LengthDelimited,
2593 )
2594 .encode(buf);
2595 ::buffa::types::encode_string(v, buf);
2596 }
2597 if !self.credential_id.is_empty() {
2598 ::buffa::encoding::Tag::new(
2599 8u32,
2600 ::buffa::encoding::WireType::LengthDelimited,
2601 )
2602 .encode(buf);
2603 ::buffa::types::encode_string(&self.credential_id, buf);
2604 }
2605 if let Some(v) = self.created_at {
2606 ::buffa::encoding::Tag::new(
2607 9u32,
2608 ::buffa::encoding::WireType::Varint,
2609 )
2610 .encode(buf);
2611 ::buffa::types::encode_int64(v, buf);
2612 }
2613 if let Some(ref v) = self.created_by {
2614 ::buffa::encoding::Tag::new(
2615 10u32,
2616 ::buffa::encoding::WireType::LengthDelimited,
2617 )
2618 .encode(buf);
2619 ::buffa::types::encode_string(v, buf);
2620 }
2621 if let Some(v) = self.updated_at {
2622 ::buffa::encoding::Tag::new(
2623 11u32,
2624 ::buffa::encoding::WireType::Varint,
2625 )
2626 .encode(buf);
2627 ::buffa::types::encode_int64(v, buf);
2628 }
2629 if let Some(ref v) = self.updated_by {
2630 ::buffa::encoding::Tag::new(
2631 12u32,
2632 ::buffa::encoding::WireType::LengthDelimited,
2633 )
2634 .encode(buf);
2635 ::buffa::types::encode_string(v, buf);
2636 }
2637 if let Some(v) = self.browse_only {
2638 ::buffa::encoding::Tag::new(
2639 13u32,
2640 ::buffa::encoding::WireType::Varint,
2641 )
2642 .encode(buf);
2643 ::buffa::types::encode_bool(v, buf);
2644 }
2645 if let Some(ref v) = self.external_location_id {
2646 ::buffa::encoding::Tag::new(
2647 100u32,
2648 ::buffa::encoding::WireType::LengthDelimited,
2649 )
2650 .encode(buf);
2651 ::buffa::types::encode_string(v, buf);
2652 }
2653 self.__buffa_unknown_fields.write_to(buf);
2654 }
2655 }
2656 impl<'__a> ::serde::Serialize for ExternalLocationView<'__a> {
2668 fn serialize<__S: ::serde::Serializer>(
2669 &self,
2670 __s: __S,
2671 ) -> ::core::result::Result<__S::Ok, __S::Error> {
2672 use ::serde::ser::SerializeMap as _;
2673 let mut __map = __s.serialize_map(::core::option::Option::None)?;
2674 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
2675 __map.serialize_entry("name", self.name)?;
2676 }
2677 if !::buffa::json_helpers::skip_if::is_empty_str(self.url) {
2678 __map.serialize_entry("url", self.url)?;
2679 }
2680 if !::buffa::json_helpers::skip_if::is_empty_str(self.credential_name) {
2681 __map.serialize_entry("credential_name", self.credential_name)?;
2682 }
2683 if self.read_only {
2684 __map.serialize_entry("read_only", &self.read_only)?;
2685 }
2686 if let ::core::option::Option::Some(__v) = self.comment {
2687 __map.serialize_entry("comment", __v)?;
2688 }
2689 if let ::core::option::Option::Some(__v) = self.owner {
2690 __map.serialize_entry("owner", __v)?;
2691 }
2692 if !::buffa::json_helpers::skip_if::is_empty_str(self.credential_id) {
2693 __map.serialize_entry("credential_id", self.credential_id)?;
2694 }
2695 if let ::core::option::Option::Some(__v) = self.created_at {
2696 struct _W(i64);
2697 impl ::serde::Serialize for _W {
2698 fn serialize<__S: ::serde::Serializer>(
2699 &self,
2700 __s: __S,
2701 ) -> ::core::result::Result<__S::Ok, __S::Error> {
2702 ::buffa::json_helpers::int64::serialize(&self.0, __s)
2703 }
2704 }
2705 __map.serialize_entry("created_at", &_W(__v))?;
2706 }
2707 if let ::core::option::Option::Some(__v) = self.created_by {
2708 __map.serialize_entry("created_by", __v)?;
2709 }
2710 if let ::core::option::Option::Some(__v) = self.updated_at {
2711 struct _W(i64);
2712 impl ::serde::Serialize for _W {
2713 fn serialize<__S: ::serde::Serializer>(
2714 &self,
2715 __s: __S,
2716 ) -> ::core::result::Result<__S::Ok, __S::Error> {
2717 ::buffa::json_helpers::int64::serialize(&self.0, __s)
2718 }
2719 }
2720 __map.serialize_entry("updated_at", &_W(__v))?;
2721 }
2722 if let ::core::option::Option::Some(__v) = self.updated_by {
2723 __map.serialize_entry("updated_by", __v)?;
2724 }
2725 if let ::core::option::Option::Some(__v) = self.browse_only {
2726 __map.serialize_entry("browse_only", &__v)?;
2727 }
2728 if let ::core::option::Option::Some(__v) = self.external_location_id {
2729 __map.serialize_entry("external_location_id", __v)?;
2730 }
2731 __map.end()
2732 }
2733 }
2734 impl<'a> ::buffa::MessageName for ExternalLocationView<'a> {
2735 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
2736 const NAME: &'static str = "ExternalLocation";
2737 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.ExternalLocation";
2738 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ExternalLocation";
2739 }
2740 impl<'v> ::buffa::DefaultViewInstance for ExternalLocationView<'v> {
2741 fn default_view_instance<'a>() -> &'a Self
2742 where
2743 Self: 'a,
2744 {
2745 static VALUE: ::buffa::__private::OnceBox<
2746 ExternalLocationView<'static>,
2747 > = ::buffa::__private::OnceBox::new();
2748 VALUE
2749 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
2750 <ExternalLocationView<'static>>::default(),
2751 ))
2752 }
2753 }
2754 impl ::buffa::ViewReborrow for ExternalLocationView<'static> {
2755 type Reborrowed<'b> = ExternalLocationView<'b>;
2756 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
2757 this
2758 }
2759 }
2760 #[derive(Clone, Debug)]
2766 pub struct ExternalLocationOwnedView(
2767 ::buffa::OwnedView<ExternalLocationView<'static>>,
2768 );
2769 impl ExternalLocationOwnedView {
2770 pub fn decode(
2780 bytes: ::buffa::bytes::Bytes,
2781 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2782 ::core::result::Result::Ok(
2783 ExternalLocationOwnedView(::buffa::OwnedView::decode(bytes)?),
2784 )
2785 }
2786 pub fn decode_with_options(
2794 bytes: ::buffa::bytes::Bytes,
2795 opts: &::buffa::DecodeOptions,
2796 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2797 ::core::result::Result::Ok(
2798 ExternalLocationOwnedView(
2799 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
2800 ),
2801 )
2802 }
2803 pub fn from_owned(
2810 msg: &super::super::ExternalLocation,
2811 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2812 ::core::result::Result::Ok(
2813 ExternalLocationOwnedView(::buffa::OwnedView::from_owned(msg)?),
2814 )
2815 }
2816 #[must_use]
2818 pub fn view(&self) -> &ExternalLocationView<'_> {
2819 self.0.reborrow()
2820 }
2821 #[must_use]
2823 pub fn to_owned_message(&self) -> super::super::ExternalLocation {
2824 self.0.to_owned_message()
2825 }
2826 #[must_use]
2828 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
2829 self.0.bytes()
2830 }
2831 #[must_use]
2833 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
2834 self.0.into_bytes()
2835 }
2836 #[must_use]
2840 pub fn name(&self) -> &'_ str {
2841 self.0.reborrow().name
2842 }
2843 #[must_use]
2847 pub fn url(&self) -> &'_ str {
2848 self.0.reborrow().url
2849 }
2850 #[must_use]
2854 pub fn credential_name(&self) -> &'_ str {
2855 self.0.reborrow().credential_name
2856 }
2857 #[must_use]
2861 pub fn read_only(&self) -> bool {
2862 self.0.reborrow().read_only
2863 }
2864 #[must_use]
2868 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
2869 self.0.reborrow().comment
2870 }
2871 #[must_use]
2875 pub fn owner(&self) -> ::core::option::Option<&'_ str> {
2876 self.0.reborrow().owner
2877 }
2878 #[must_use]
2885 pub fn credential_id(&self) -> &'_ str {
2886 self.0.reborrow().credential_id
2887 }
2888 #[must_use]
2892 pub fn created_at(&self) -> ::core::option::Option<i64> {
2893 self.0.reborrow().created_at
2894 }
2895 #[must_use]
2899 pub fn created_by(&self) -> ::core::option::Option<&'_ str> {
2900 self.0.reborrow().created_by
2901 }
2902 #[must_use]
2906 pub fn updated_at(&self) -> ::core::option::Option<i64> {
2907 self.0.reborrow().updated_at
2908 }
2909 #[must_use]
2913 pub fn updated_by(&self) -> ::core::option::Option<&'_ str> {
2914 self.0.reborrow().updated_by
2915 }
2916 #[must_use]
2921 pub fn browse_only(&self) -> ::core::option::Option<bool> {
2922 self.0.reborrow().browse_only
2923 }
2924 #[must_use]
2926 pub fn external_location_id(&self) -> ::core::option::Option<&'_ str> {
2927 self.0.reborrow().external_location_id
2928 }
2929 }
2930 impl ::core::convert::From<::buffa::OwnedView<ExternalLocationView<'static>>>
2931 for ExternalLocationOwnedView {
2932 fn from(inner: ::buffa::OwnedView<ExternalLocationView<'static>>) -> Self {
2933 ExternalLocationOwnedView(inner)
2934 }
2935 }
2936 impl ::core::convert::From<ExternalLocationOwnedView>
2937 for ::buffa::OwnedView<ExternalLocationView<'static>> {
2938 fn from(wrapper: ExternalLocationOwnedView) -> Self {
2939 wrapper.0
2940 }
2941 }
2942 impl ::core::convert::AsRef<::buffa::OwnedView<ExternalLocationView<'static>>>
2943 for ExternalLocationOwnedView {
2944 fn as_ref(&self) -> &::buffa::OwnedView<ExternalLocationView<'static>> {
2945 &self.0
2946 }
2947 }
2948 impl ::buffa::HasMessageView for super::super::ExternalLocation {
2949 type View<'a> = ExternalLocationView<'a>;
2950 type ViewHandle = ExternalLocationOwnedView;
2951 }
2952 impl ::serde::Serialize for ExternalLocationOwnedView {
2953 fn serialize<__S: ::serde::Serializer>(
2954 &self,
2955 __s: __S,
2956 ) -> ::core::result::Result<__S::Ok, __S::Error> {
2957 ::serde::Serialize::serialize(&self.0, __s)
2958 }
2959 }
2960 #[derive(Clone, Debug, Default)]
2962 pub struct ListExternalLocationsRequestView<'a> {
2963 pub max_results: ::core::option::Option<i32>,
2967 pub page_token: ::core::option::Option<&'a str>,
2971 pub include_browse: ::core::option::Option<bool>,
2975 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
2976 }
2977 impl<'a> ListExternalLocationsRequestView<'a> {
2978 #[doc(hidden)]
2986 pub fn _decode_depth(
2987 buf: &'a [u8],
2988 depth: u32,
2989 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
2990 let mut view = Self::default();
2991 view._merge_into_view(buf, depth)?;
2992 ::core::result::Result::Ok(view)
2993 }
2994 #[doc(hidden)]
3002 pub fn _merge_into_view(
3003 &mut self,
3004 buf: &'a [u8],
3005 depth: u32,
3006 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3007 let _ = depth;
3008 #[allow(unused_variables)]
3009 let view = self;
3010 let mut cur: &'a [u8] = buf;
3011 while !cur.is_empty() {
3012 let before_tag = cur;
3013 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
3014 match tag.field_number() {
3015 2u32 => {
3016 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3017 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3018 field_number: 2u32,
3019 expected: 0u8,
3020 actual: tag.wire_type() as u8,
3021 });
3022 }
3023 view.max_results = Some(
3024 ::buffa::types::decode_int32(&mut cur)?,
3025 );
3026 }
3027 3u32 => {
3028 if tag.wire_type()
3029 != ::buffa::encoding::WireType::LengthDelimited
3030 {
3031 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3032 field_number: 3u32,
3033 expected: 2u8,
3034 actual: tag.wire_type() as u8,
3035 });
3036 }
3037 view.page_token = Some(
3038 ::buffa::types::borrow_str(&mut cur)?,
3039 );
3040 }
3041 4u32 => {
3042 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3043 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3044 field_number: 4u32,
3045 expected: 0u8,
3046 actual: tag.wire_type() as u8,
3047 });
3048 }
3049 view.include_browse = Some(
3050 ::buffa::types::decode_bool(&mut cur)?,
3051 );
3052 }
3053 _ => {
3054 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
3055 let span_len = before_tag.len() - cur.len();
3056 view.__buffa_unknown_fields
3057 .push_raw(&before_tag[..span_len]);
3058 }
3059 }
3060 }
3061 ::core::result::Result::Ok(())
3062 }
3063 }
3064 impl<'a> ::buffa::MessageView<'a> for ListExternalLocationsRequestView<'a> {
3065 type Owned = super::super::ListExternalLocationsRequest;
3066 fn decode_view(
3067 buf: &'a [u8],
3068 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3069 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
3070 }
3071 fn decode_view_with_limit(
3072 buf: &'a [u8],
3073 depth: u32,
3074 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3075 Self::_decode_depth(buf, depth)
3076 }
3077 fn to_owned_message(&self) -> super::super::ListExternalLocationsRequest {
3078 self.to_owned_from_source(None)
3079 }
3080 #[allow(clippy::useless_conversion, clippy::needless_update)]
3081 fn to_owned_from_source(
3082 &self,
3083 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3084 ) -> super::super::ListExternalLocationsRequest {
3085 #[allow(unused_imports)]
3086 use ::buffa::alloc::string::ToString as _;
3087 let _ = __buffa_src;
3088 super::super::ListExternalLocationsRequest {
3089 max_results: self.max_results,
3090 page_token: self.page_token.map(|s| s.to_string()),
3091 include_browse: self.include_browse,
3092 __buffa_unknown_fields: self
3093 .__buffa_unknown_fields
3094 .to_owned()
3095 .unwrap_or_default()
3096 .into(),
3097 ..::core::default::Default::default()
3098 }
3099 }
3100 }
3101 impl<'a> ::buffa::ViewEncode<'a> for ListExternalLocationsRequestView<'a> {
3102 #[allow(clippy::needless_borrow, clippy::let_and_return)]
3103 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3104 #[allow(unused_imports)]
3105 use ::buffa::Enumeration as _;
3106 let mut size = 0u32;
3107 if let Some(v) = self.max_results {
3108 size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
3109 }
3110 if let Some(ref v) = self.page_token {
3111 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3112 }
3113 if self.include_browse.is_some() {
3114 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
3115 }
3116 size += self.__buffa_unknown_fields.encoded_len() as u32;
3117 size
3118 }
3119 #[allow(clippy::needless_borrow)]
3120 fn write_to(
3121 &self,
3122 _cache: &mut ::buffa::SizeCache,
3123 buf: &mut impl ::buffa::bytes::BufMut,
3124 ) {
3125 #[allow(unused_imports)]
3126 use ::buffa::Enumeration as _;
3127 if let Some(v) = self.max_results {
3128 ::buffa::encoding::Tag::new(
3129 2u32,
3130 ::buffa::encoding::WireType::Varint,
3131 )
3132 .encode(buf);
3133 ::buffa::types::encode_int32(v, buf);
3134 }
3135 if let Some(ref v) = self.page_token {
3136 ::buffa::encoding::Tag::new(
3137 3u32,
3138 ::buffa::encoding::WireType::LengthDelimited,
3139 )
3140 .encode(buf);
3141 ::buffa::types::encode_string(v, buf);
3142 }
3143 if let Some(v) = self.include_browse {
3144 ::buffa::encoding::Tag::new(
3145 4u32,
3146 ::buffa::encoding::WireType::Varint,
3147 )
3148 .encode(buf);
3149 ::buffa::types::encode_bool(v, buf);
3150 }
3151 self.__buffa_unknown_fields.write_to(buf);
3152 }
3153 }
3154 impl<'__a> ::serde::Serialize for ListExternalLocationsRequestView<'__a> {
3166 fn serialize<__S: ::serde::Serializer>(
3167 &self,
3168 __s: __S,
3169 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3170 use ::serde::ser::SerializeMap as _;
3171 let mut __map = __s.serialize_map(::core::option::Option::None)?;
3172 if let ::core::option::Option::Some(__v) = self.max_results {
3173 struct _W(i32);
3174 impl ::serde::Serialize for _W {
3175 fn serialize<__S: ::serde::Serializer>(
3176 &self,
3177 __s: __S,
3178 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3179 ::buffa::json_helpers::int32::serialize(&self.0, __s)
3180 }
3181 }
3182 __map.serialize_entry("max_results", &_W(__v))?;
3183 }
3184 if let ::core::option::Option::Some(__v) = self.page_token {
3185 __map.serialize_entry("page_token", __v)?;
3186 }
3187 if let ::core::option::Option::Some(__v) = self.include_browse {
3188 __map.serialize_entry("include_browse", &__v)?;
3189 }
3190 __map.end()
3191 }
3192 }
3193 impl<'a> ::buffa::MessageName for ListExternalLocationsRequestView<'a> {
3194 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
3195 const NAME: &'static str = "ListExternalLocationsRequest";
3196 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.ListExternalLocationsRequest";
3197 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsRequest";
3198 }
3199 impl<'v> ::buffa::DefaultViewInstance for ListExternalLocationsRequestView<'v> {
3200 fn default_view_instance<'a>() -> &'a Self
3201 where
3202 Self: 'a,
3203 {
3204 static VALUE: ::buffa::__private::OnceBox<
3205 ListExternalLocationsRequestView<'static>,
3206 > = ::buffa::__private::OnceBox::new();
3207 VALUE
3208 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
3209 <ListExternalLocationsRequestView<'static>>::default(),
3210 ))
3211 }
3212 }
3213 impl ::buffa::ViewReborrow for ListExternalLocationsRequestView<'static> {
3214 type Reborrowed<'b> = ListExternalLocationsRequestView<'b>;
3215 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
3216 this
3217 }
3218 }
3219 #[derive(Clone, Debug)]
3225 pub struct ListExternalLocationsRequestOwnedView(
3226 ::buffa::OwnedView<ListExternalLocationsRequestView<'static>>,
3227 );
3228 impl ListExternalLocationsRequestOwnedView {
3229 pub fn decode(
3239 bytes: ::buffa::bytes::Bytes,
3240 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3241 ::core::result::Result::Ok(
3242 ListExternalLocationsRequestOwnedView(
3243 ::buffa::OwnedView::decode(bytes)?,
3244 ),
3245 )
3246 }
3247 pub fn decode_with_options(
3255 bytes: ::buffa::bytes::Bytes,
3256 opts: &::buffa::DecodeOptions,
3257 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3258 ::core::result::Result::Ok(
3259 ListExternalLocationsRequestOwnedView(
3260 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
3261 ),
3262 )
3263 }
3264 pub fn from_owned(
3271 msg: &super::super::ListExternalLocationsRequest,
3272 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3273 ::core::result::Result::Ok(
3274 ListExternalLocationsRequestOwnedView(
3275 ::buffa::OwnedView::from_owned(msg)?,
3276 ),
3277 )
3278 }
3279 #[must_use]
3281 pub fn view(&self) -> &ListExternalLocationsRequestView<'_> {
3282 self.0.reborrow()
3283 }
3284 #[must_use]
3286 pub fn to_owned_message(
3287 &self,
3288 ) -> super::super::ListExternalLocationsRequest {
3289 self.0.to_owned_message()
3290 }
3291 #[must_use]
3293 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3294 self.0.bytes()
3295 }
3296 #[must_use]
3298 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3299 self.0.into_bytes()
3300 }
3301 #[must_use]
3305 pub fn max_results(&self) -> ::core::option::Option<i32> {
3306 self.0.reborrow().max_results
3307 }
3308 #[must_use]
3312 pub fn page_token(&self) -> ::core::option::Option<&'_ str> {
3313 self.0.reborrow().page_token
3314 }
3315 #[must_use]
3319 pub fn include_browse(&self) -> ::core::option::Option<bool> {
3320 self.0.reborrow().include_browse
3321 }
3322 }
3323 impl ::core::convert::From<
3324 ::buffa::OwnedView<ListExternalLocationsRequestView<'static>>,
3325 > for ListExternalLocationsRequestOwnedView {
3326 fn from(
3327 inner: ::buffa::OwnedView<ListExternalLocationsRequestView<'static>>,
3328 ) -> Self {
3329 ListExternalLocationsRequestOwnedView(inner)
3330 }
3331 }
3332 impl ::core::convert::From<ListExternalLocationsRequestOwnedView>
3333 for ::buffa::OwnedView<ListExternalLocationsRequestView<'static>> {
3334 fn from(wrapper: ListExternalLocationsRequestOwnedView) -> Self {
3335 wrapper.0
3336 }
3337 }
3338 impl ::core::convert::AsRef<
3339 ::buffa::OwnedView<ListExternalLocationsRequestView<'static>>,
3340 > for ListExternalLocationsRequestOwnedView {
3341 fn as_ref(
3342 &self,
3343 ) -> &::buffa::OwnedView<ListExternalLocationsRequestView<'static>> {
3344 &self.0
3345 }
3346 }
3347 impl ::buffa::HasMessageView for super::super::ListExternalLocationsRequest {
3348 type View<'a> = ListExternalLocationsRequestView<'a>;
3349 type ViewHandle = ListExternalLocationsRequestOwnedView;
3350 }
3351 impl ::serde::Serialize for ListExternalLocationsRequestOwnedView {
3352 fn serialize<__S: ::serde::Serializer>(
3353 &self,
3354 __s: __S,
3355 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3356 ::serde::Serialize::serialize(&self.0, __s)
3357 }
3358 }
3359 #[derive(Clone, Debug, Default)]
3361 pub struct ListExternalLocationsResponseView<'a> {
3362 pub external_locations: ::buffa::RepeatedView<
3366 'a,
3367 super::super::__buffa::view::ExternalLocationView<'a>,
3368 >,
3369 pub next_page_token: ::core::option::Option<&'a str>,
3373 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
3374 }
3375 impl<'a> ListExternalLocationsResponseView<'a> {
3376 #[doc(hidden)]
3384 pub fn _decode_depth(
3385 buf: &'a [u8],
3386 depth: u32,
3387 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3388 let mut view = Self::default();
3389 view._merge_into_view(buf, depth)?;
3390 ::core::result::Result::Ok(view)
3391 }
3392 #[doc(hidden)]
3400 pub fn _merge_into_view(
3401 &mut self,
3402 buf: &'a [u8],
3403 depth: u32,
3404 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3405 let _ = depth;
3406 #[allow(unused_variables)]
3407 let view = self;
3408 let mut cur: &'a [u8] = buf;
3409 while !cur.is_empty() {
3410 let before_tag = cur;
3411 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
3412 match tag.field_number() {
3413 2u32 => {
3414 if tag.wire_type()
3415 != ::buffa::encoding::WireType::LengthDelimited
3416 {
3417 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3418 field_number: 2u32,
3419 expected: 2u8,
3420 actual: tag.wire_type() as u8,
3421 });
3422 }
3423 view.next_page_token = Some(
3424 ::buffa::types::borrow_str(&mut cur)?,
3425 );
3426 }
3427 1u32 => {
3428 if tag.wire_type()
3429 != ::buffa::encoding::WireType::LengthDelimited
3430 {
3431 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3432 field_number: 1u32,
3433 expected: 2u8,
3434 actual: tag.wire_type() as u8,
3435 });
3436 }
3437 if depth == 0 {
3438 return Err(::buffa::DecodeError::RecursionLimitExceeded);
3439 }
3440 let sub = ::buffa::types::borrow_bytes(&mut cur)?;
3441 view.external_locations
3442 .push(
3443 super::super::__buffa::view::ExternalLocationView::_decode_depth(
3444 sub,
3445 depth - 1,
3446 )?,
3447 );
3448 }
3449 _ => {
3450 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
3451 let span_len = before_tag.len() - cur.len();
3452 view.__buffa_unknown_fields
3453 .push_raw(&before_tag[..span_len]);
3454 }
3455 }
3456 }
3457 ::core::result::Result::Ok(())
3458 }
3459 }
3460 impl<'a> ::buffa::MessageView<'a> for ListExternalLocationsResponseView<'a> {
3461 type Owned = super::super::ListExternalLocationsResponse;
3462 fn decode_view(
3463 buf: &'a [u8],
3464 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3465 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
3466 }
3467 fn decode_view_with_limit(
3468 buf: &'a [u8],
3469 depth: u32,
3470 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3471 Self::_decode_depth(buf, depth)
3472 }
3473 fn to_owned_message(&self) -> super::super::ListExternalLocationsResponse {
3474 self.to_owned_from_source(None)
3475 }
3476 #[allow(clippy::useless_conversion, clippy::needless_update)]
3477 fn to_owned_from_source(
3478 &self,
3479 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3480 ) -> super::super::ListExternalLocationsResponse {
3481 #[allow(unused_imports)]
3482 use ::buffa::alloc::string::ToString as _;
3483 let _ = __buffa_src;
3484 super::super::ListExternalLocationsResponse {
3485 external_locations: self
3486 .external_locations
3487 .iter()
3488 .map(|v| v.to_owned_from_source(__buffa_src))
3489 .collect(),
3490 next_page_token: self.next_page_token.map(|s| s.to_string()),
3491 __buffa_unknown_fields: self
3492 .__buffa_unknown_fields
3493 .to_owned()
3494 .unwrap_or_default()
3495 .into(),
3496 ..::core::default::Default::default()
3497 }
3498 }
3499 }
3500 impl<'a> ::buffa::ViewEncode<'a> for ListExternalLocationsResponseView<'a> {
3501 #[allow(clippy::needless_borrow, clippy::let_and_return)]
3502 fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
3503 #[allow(unused_imports)]
3504 use ::buffa::Enumeration as _;
3505 let mut size = 0u32;
3506 for v in &self.external_locations {
3507 let __slot = __cache.reserve();
3508 let inner_size = v.compute_size(__cache);
3509 __cache.set(__slot, inner_size);
3510 size
3511 += 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
3512 + inner_size;
3513 }
3514 if let Some(ref v) = self.next_page_token {
3515 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3516 }
3517 size += self.__buffa_unknown_fields.encoded_len() as u32;
3518 size
3519 }
3520 #[allow(clippy::needless_borrow)]
3521 fn write_to(
3522 &self,
3523 __cache: &mut ::buffa::SizeCache,
3524 buf: &mut impl ::buffa::bytes::BufMut,
3525 ) {
3526 #[allow(unused_imports)]
3527 use ::buffa::Enumeration as _;
3528 for v in &self.external_locations {
3529 ::buffa::encoding::Tag::new(
3530 1u32,
3531 ::buffa::encoding::WireType::LengthDelimited,
3532 )
3533 .encode(buf);
3534 ::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
3535 v.write_to(__cache, buf);
3536 }
3537 if let Some(ref v) = self.next_page_token {
3538 ::buffa::encoding::Tag::new(
3539 2u32,
3540 ::buffa::encoding::WireType::LengthDelimited,
3541 )
3542 .encode(buf);
3543 ::buffa::types::encode_string(v, buf);
3544 }
3545 self.__buffa_unknown_fields.write_to(buf);
3546 }
3547 }
3548 impl<'__a> ::serde::Serialize for ListExternalLocationsResponseView<'__a> {
3560 fn serialize<__S: ::serde::Serializer>(
3561 &self,
3562 __s: __S,
3563 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3564 use ::serde::ser::SerializeMap as _;
3565 let mut __map = __s.serialize_map(::core::option::Option::None)?;
3566 if !self.external_locations.is_empty() {
3567 __map
3568 .serialize_entry(
3569 "externalLocations",
3570 &*self.external_locations,
3571 )?;
3572 }
3573 if let ::core::option::Option::Some(__v) = self.next_page_token {
3574 __map.serialize_entry("next_page_token", __v)?;
3575 }
3576 __map.end()
3577 }
3578 }
3579 impl<'a> ::buffa::MessageName for ListExternalLocationsResponseView<'a> {
3580 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
3581 const NAME: &'static str = "ListExternalLocationsResponse";
3582 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.ListExternalLocationsResponse";
3583 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsResponse";
3584 }
3585 impl<'v> ::buffa::DefaultViewInstance for ListExternalLocationsResponseView<'v> {
3586 fn default_view_instance<'a>() -> &'a Self
3587 where
3588 Self: 'a,
3589 {
3590 static VALUE: ::buffa::__private::OnceBox<
3591 ListExternalLocationsResponseView<'static>,
3592 > = ::buffa::__private::OnceBox::new();
3593 VALUE
3594 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
3595 <ListExternalLocationsResponseView<'static>>::default(),
3596 ))
3597 }
3598 }
3599 impl ::buffa::ViewReborrow for ListExternalLocationsResponseView<'static> {
3600 type Reborrowed<'b> = ListExternalLocationsResponseView<'b>;
3601 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
3602 this
3603 }
3604 }
3605 #[derive(Clone, Debug)]
3611 pub struct ListExternalLocationsResponseOwnedView(
3612 ::buffa::OwnedView<ListExternalLocationsResponseView<'static>>,
3613 );
3614 impl ListExternalLocationsResponseOwnedView {
3615 pub fn decode(
3625 bytes: ::buffa::bytes::Bytes,
3626 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3627 ::core::result::Result::Ok(
3628 ListExternalLocationsResponseOwnedView(
3629 ::buffa::OwnedView::decode(bytes)?,
3630 ),
3631 )
3632 }
3633 pub fn decode_with_options(
3641 bytes: ::buffa::bytes::Bytes,
3642 opts: &::buffa::DecodeOptions,
3643 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3644 ::core::result::Result::Ok(
3645 ListExternalLocationsResponseOwnedView(
3646 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
3647 ),
3648 )
3649 }
3650 pub fn from_owned(
3657 msg: &super::super::ListExternalLocationsResponse,
3658 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3659 ::core::result::Result::Ok(
3660 ListExternalLocationsResponseOwnedView(
3661 ::buffa::OwnedView::from_owned(msg)?,
3662 ),
3663 )
3664 }
3665 #[must_use]
3667 pub fn view(&self) -> &ListExternalLocationsResponseView<'_> {
3668 self.0.reborrow()
3669 }
3670 #[must_use]
3672 pub fn to_owned_message(
3673 &self,
3674 ) -> super::super::ListExternalLocationsResponse {
3675 self.0.to_owned_message()
3676 }
3677 #[must_use]
3679 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
3680 self.0.bytes()
3681 }
3682 #[must_use]
3684 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
3685 self.0.into_bytes()
3686 }
3687 #[must_use]
3691 pub fn external_locations(
3692 &self,
3693 ) -> &::buffa::RepeatedView<
3694 '_,
3695 super::super::__buffa::view::ExternalLocationView<'_>,
3696 > {
3697 &self.0.reborrow().external_locations
3698 }
3699 #[must_use]
3703 pub fn next_page_token(&self) -> ::core::option::Option<&'_ str> {
3704 self.0.reborrow().next_page_token
3705 }
3706 }
3707 impl ::core::convert::From<
3708 ::buffa::OwnedView<ListExternalLocationsResponseView<'static>>,
3709 > for ListExternalLocationsResponseOwnedView {
3710 fn from(
3711 inner: ::buffa::OwnedView<ListExternalLocationsResponseView<'static>>,
3712 ) -> Self {
3713 ListExternalLocationsResponseOwnedView(inner)
3714 }
3715 }
3716 impl ::core::convert::From<ListExternalLocationsResponseOwnedView>
3717 for ::buffa::OwnedView<ListExternalLocationsResponseView<'static>> {
3718 fn from(wrapper: ListExternalLocationsResponseOwnedView) -> Self {
3719 wrapper.0
3720 }
3721 }
3722 impl ::core::convert::AsRef<
3723 ::buffa::OwnedView<ListExternalLocationsResponseView<'static>>,
3724 > for ListExternalLocationsResponseOwnedView {
3725 fn as_ref(
3726 &self,
3727 ) -> &::buffa::OwnedView<ListExternalLocationsResponseView<'static>> {
3728 &self.0
3729 }
3730 }
3731 impl ::buffa::HasMessageView for super::super::ListExternalLocationsResponse {
3732 type View<'a> = ListExternalLocationsResponseView<'a>;
3733 type ViewHandle = ListExternalLocationsResponseOwnedView;
3734 }
3735 impl ::serde::Serialize for ListExternalLocationsResponseOwnedView {
3736 fn serialize<__S: ::serde::Serializer>(
3737 &self,
3738 __s: __S,
3739 ) -> ::core::result::Result<__S::Ok, __S::Error> {
3740 ::serde::Serialize::serialize(&self.0, __s)
3741 }
3742 }
3743 #[derive(Clone, Debug, Default)]
3745 pub struct CreateExternalLocationRequestView<'a> {
3746 pub name: &'a str,
3750 pub url: &'a str,
3754 pub credential_name: &'a str,
3758 pub read_only: ::core::option::Option<bool>,
3762 pub comment: ::core::option::Option<&'a str>,
3766 pub skip_validation: ::core::option::Option<bool>,
3770 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
3771 }
3772 impl<'a> CreateExternalLocationRequestView<'a> {
3773 #[doc(hidden)]
3781 pub fn _decode_depth(
3782 buf: &'a [u8],
3783 depth: u32,
3784 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3785 let mut view = Self::default();
3786 view._merge_into_view(buf, depth)?;
3787 ::core::result::Result::Ok(view)
3788 }
3789 #[doc(hidden)]
3797 pub fn _merge_into_view(
3798 &mut self,
3799 buf: &'a [u8],
3800 depth: u32,
3801 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
3802 let _ = depth;
3803 #[allow(unused_variables)]
3804 let view = self;
3805 let mut cur: &'a [u8] = buf;
3806 while !cur.is_empty() {
3807 let before_tag = cur;
3808 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
3809 match tag.field_number() {
3810 1u32 => {
3811 if tag.wire_type()
3812 != ::buffa::encoding::WireType::LengthDelimited
3813 {
3814 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3815 field_number: 1u32,
3816 expected: 2u8,
3817 actual: tag.wire_type() as u8,
3818 });
3819 }
3820 view.name = ::buffa::types::borrow_str(&mut cur)?;
3821 }
3822 2u32 => {
3823 if tag.wire_type()
3824 != ::buffa::encoding::WireType::LengthDelimited
3825 {
3826 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3827 field_number: 2u32,
3828 expected: 2u8,
3829 actual: tag.wire_type() as u8,
3830 });
3831 }
3832 view.url = ::buffa::types::borrow_str(&mut cur)?;
3833 }
3834 3u32 => {
3835 if tag.wire_type()
3836 != ::buffa::encoding::WireType::LengthDelimited
3837 {
3838 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3839 field_number: 3u32,
3840 expected: 2u8,
3841 actual: tag.wire_type() as u8,
3842 });
3843 }
3844 view.credential_name = ::buffa::types::borrow_str(&mut cur)?;
3845 }
3846 4u32 => {
3847 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3848 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3849 field_number: 4u32,
3850 expected: 0u8,
3851 actual: tag.wire_type() as u8,
3852 });
3853 }
3854 view.read_only = Some(
3855 ::buffa::types::decode_bool(&mut cur)?,
3856 );
3857 }
3858 5u32 => {
3859 if tag.wire_type()
3860 != ::buffa::encoding::WireType::LengthDelimited
3861 {
3862 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3863 field_number: 5u32,
3864 expected: 2u8,
3865 actual: tag.wire_type() as u8,
3866 });
3867 }
3868 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
3869 }
3870 6u32 => {
3871 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
3872 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
3873 field_number: 6u32,
3874 expected: 0u8,
3875 actual: tag.wire_type() as u8,
3876 });
3877 }
3878 view.skip_validation = Some(
3879 ::buffa::types::decode_bool(&mut cur)?,
3880 );
3881 }
3882 _ => {
3883 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
3884 let span_len = before_tag.len() - cur.len();
3885 view.__buffa_unknown_fields
3886 .push_raw(&before_tag[..span_len]);
3887 }
3888 }
3889 }
3890 ::core::result::Result::Ok(())
3891 }
3892 }
3893 impl<'a> ::buffa::MessageView<'a> for CreateExternalLocationRequestView<'a> {
3894 type Owned = super::super::CreateExternalLocationRequest;
3895 fn decode_view(
3896 buf: &'a [u8],
3897 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3898 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
3899 }
3900 fn decode_view_with_limit(
3901 buf: &'a [u8],
3902 depth: u32,
3903 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
3904 Self::_decode_depth(buf, depth)
3905 }
3906 fn to_owned_message(&self) -> super::super::CreateExternalLocationRequest {
3907 self.to_owned_from_source(None)
3908 }
3909 #[allow(clippy::useless_conversion, clippy::needless_update)]
3910 fn to_owned_from_source(
3911 &self,
3912 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
3913 ) -> super::super::CreateExternalLocationRequest {
3914 #[allow(unused_imports)]
3915 use ::buffa::alloc::string::ToString as _;
3916 let _ = __buffa_src;
3917 super::super::CreateExternalLocationRequest {
3918 name: self.name.to_string(),
3919 url: self.url.to_string(),
3920 credential_name: self.credential_name.to_string(),
3921 read_only: self.read_only,
3922 comment: self.comment.map(|s| s.to_string()),
3923 skip_validation: self.skip_validation,
3924 __buffa_unknown_fields: self
3925 .__buffa_unknown_fields
3926 .to_owned()
3927 .unwrap_or_default()
3928 .into(),
3929 ..::core::default::Default::default()
3930 }
3931 }
3932 }
3933 impl<'a> ::buffa::ViewEncode<'a> for CreateExternalLocationRequestView<'a> {
3934 #[allow(clippy::needless_borrow, clippy::let_and_return)]
3935 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
3936 #[allow(unused_imports)]
3937 use ::buffa::Enumeration as _;
3938 let mut size = 0u32;
3939 if !self.name.is_empty() {
3940 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
3941 }
3942 if !self.url.is_empty() {
3943 size += 1u32 + ::buffa::types::string_encoded_len(&self.url) as u32;
3944 }
3945 if !self.credential_name.is_empty() {
3946 size
3947 += 1u32
3948 + ::buffa::types::string_encoded_len(&self.credential_name)
3949 as u32;
3950 }
3951 if self.read_only.is_some() {
3952 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
3953 }
3954 if let Some(ref v) = self.comment {
3955 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
3956 }
3957 if self.skip_validation.is_some() {
3958 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
3959 }
3960 size += self.__buffa_unknown_fields.encoded_len() as u32;
3961 size
3962 }
3963 #[allow(clippy::needless_borrow)]
3964 fn write_to(
3965 &self,
3966 _cache: &mut ::buffa::SizeCache,
3967 buf: &mut impl ::buffa::bytes::BufMut,
3968 ) {
3969 #[allow(unused_imports)]
3970 use ::buffa::Enumeration as _;
3971 if !self.name.is_empty() {
3972 ::buffa::encoding::Tag::new(
3973 1u32,
3974 ::buffa::encoding::WireType::LengthDelimited,
3975 )
3976 .encode(buf);
3977 ::buffa::types::encode_string(&self.name, buf);
3978 }
3979 if !self.url.is_empty() {
3980 ::buffa::encoding::Tag::new(
3981 2u32,
3982 ::buffa::encoding::WireType::LengthDelimited,
3983 )
3984 .encode(buf);
3985 ::buffa::types::encode_string(&self.url, buf);
3986 }
3987 if !self.credential_name.is_empty() {
3988 ::buffa::encoding::Tag::new(
3989 3u32,
3990 ::buffa::encoding::WireType::LengthDelimited,
3991 )
3992 .encode(buf);
3993 ::buffa::types::encode_string(&self.credential_name, buf);
3994 }
3995 if let Some(v) = self.read_only {
3996 ::buffa::encoding::Tag::new(
3997 4u32,
3998 ::buffa::encoding::WireType::Varint,
3999 )
4000 .encode(buf);
4001 ::buffa::types::encode_bool(v, buf);
4002 }
4003 if let Some(ref v) = self.comment {
4004 ::buffa::encoding::Tag::new(
4005 5u32,
4006 ::buffa::encoding::WireType::LengthDelimited,
4007 )
4008 .encode(buf);
4009 ::buffa::types::encode_string(v, buf);
4010 }
4011 if let Some(v) = self.skip_validation {
4012 ::buffa::encoding::Tag::new(
4013 6u32,
4014 ::buffa::encoding::WireType::Varint,
4015 )
4016 .encode(buf);
4017 ::buffa::types::encode_bool(v, buf);
4018 }
4019 self.__buffa_unknown_fields.write_to(buf);
4020 }
4021 }
4022 impl<'__a> ::serde::Serialize for CreateExternalLocationRequestView<'__a> {
4034 fn serialize<__S: ::serde::Serializer>(
4035 &self,
4036 __s: __S,
4037 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4038 use ::serde::ser::SerializeMap as _;
4039 let mut __map = __s.serialize_map(::core::option::Option::None)?;
4040 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
4041 __map.serialize_entry("name", self.name)?;
4042 }
4043 if !::buffa::json_helpers::skip_if::is_empty_str(self.url) {
4044 __map.serialize_entry("url", self.url)?;
4045 }
4046 if !::buffa::json_helpers::skip_if::is_empty_str(self.credential_name) {
4047 __map.serialize_entry("credential_name", self.credential_name)?;
4048 }
4049 if let ::core::option::Option::Some(__v) = self.read_only {
4050 __map.serialize_entry("read_only", &__v)?;
4051 }
4052 if let ::core::option::Option::Some(__v) = self.comment {
4053 __map.serialize_entry("comment", __v)?;
4054 }
4055 if let ::core::option::Option::Some(__v) = self.skip_validation {
4056 __map.serialize_entry("skip_validation", &__v)?;
4057 }
4058 __map.end()
4059 }
4060 }
4061 impl<'a> ::buffa::MessageName for CreateExternalLocationRequestView<'a> {
4062 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
4063 const NAME: &'static str = "CreateExternalLocationRequest";
4064 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.CreateExternalLocationRequest";
4065 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.CreateExternalLocationRequest";
4066 }
4067 impl<'v> ::buffa::DefaultViewInstance for CreateExternalLocationRequestView<'v> {
4068 fn default_view_instance<'a>() -> &'a Self
4069 where
4070 Self: 'a,
4071 {
4072 static VALUE: ::buffa::__private::OnceBox<
4073 CreateExternalLocationRequestView<'static>,
4074 > = ::buffa::__private::OnceBox::new();
4075 VALUE
4076 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
4077 <CreateExternalLocationRequestView<'static>>::default(),
4078 ))
4079 }
4080 }
4081 impl ::buffa::ViewReborrow for CreateExternalLocationRequestView<'static> {
4082 type Reborrowed<'b> = CreateExternalLocationRequestView<'b>;
4083 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
4084 this
4085 }
4086 }
4087 #[derive(Clone, Debug)]
4093 pub struct CreateExternalLocationRequestOwnedView(
4094 ::buffa::OwnedView<CreateExternalLocationRequestView<'static>>,
4095 );
4096 impl CreateExternalLocationRequestOwnedView {
4097 pub fn decode(
4107 bytes: ::buffa::bytes::Bytes,
4108 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4109 ::core::result::Result::Ok(
4110 CreateExternalLocationRequestOwnedView(
4111 ::buffa::OwnedView::decode(bytes)?,
4112 ),
4113 )
4114 }
4115 pub fn decode_with_options(
4123 bytes: ::buffa::bytes::Bytes,
4124 opts: &::buffa::DecodeOptions,
4125 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4126 ::core::result::Result::Ok(
4127 CreateExternalLocationRequestOwnedView(
4128 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4129 ),
4130 )
4131 }
4132 pub fn from_owned(
4139 msg: &super::super::CreateExternalLocationRequest,
4140 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4141 ::core::result::Result::Ok(
4142 CreateExternalLocationRequestOwnedView(
4143 ::buffa::OwnedView::from_owned(msg)?,
4144 ),
4145 )
4146 }
4147 #[must_use]
4149 pub fn view(&self) -> &CreateExternalLocationRequestView<'_> {
4150 self.0.reborrow()
4151 }
4152 #[must_use]
4154 pub fn to_owned_message(
4155 &self,
4156 ) -> super::super::CreateExternalLocationRequest {
4157 self.0.to_owned_message()
4158 }
4159 #[must_use]
4161 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4162 self.0.bytes()
4163 }
4164 #[must_use]
4166 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4167 self.0.into_bytes()
4168 }
4169 #[must_use]
4173 pub fn name(&self) -> &'_ str {
4174 self.0.reborrow().name
4175 }
4176 #[must_use]
4180 pub fn url(&self) -> &'_ str {
4181 self.0.reborrow().url
4182 }
4183 #[must_use]
4187 pub fn credential_name(&self) -> &'_ str {
4188 self.0.reborrow().credential_name
4189 }
4190 #[must_use]
4194 pub fn read_only(&self) -> ::core::option::Option<bool> {
4195 self.0.reborrow().read_only
4196 }
4197 #[must_use]
4201 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
4202 self.0.reborrow().comment
4203 }
4204 #[must_use]
4208 pub fn skip_validation(&self) -> ::core::option::Option<bool> {
4209 self.0.reborrow().skip_validation
4210 }
4211 }
4212 impl ::core::convert::From<
4213 ::buffa::OwnedView<CreateExternalLocationRequestView<'static>>,
4214 > for CreateExternalLocationRequestOwnedView {
4215 fn from(
4216 inner: ::buffa::OwnedView<CreateExternalLocationRequestView<'static>>,
4217 ) -> Self {
4218 CreateExternalLocationRequestOwnedView(inner)
4219 }
4220 }
4221 impl ::core::convert::From<CreateExternalLocationRequestOwnedView>
4222 for ::buffa::OwnedView<CreateExternalLocationRequestView<'static>> {
4223 fn from(wrapper: CreateExternalLocationRequestOwnedView) -> Self {
4224 wrapper.0
4225 }
4226 }
4227 impl ::core::convert::AsRef<
4228 ::buffa::OwnedView<CreateExternalLocationRequestView<'static>>,
4229 > for CreateExternalLocationRequestOwnedView {
4230 fn as_ref(
4231 &self,
4232 ) -> &::buffa::OwnedView<CreateExternalLocationRequestView<'static>> {
4233 &self.0
4234 }
4235 }
4236 impl ::buffa::HasMessageView for super::super::CreateExternalLocationRequest {
4237 type View<'a> = CreateExternalLocationRequestView<'a>;
4238 type ViewHandle = CreateExternalLocationRequestOwnedView;
4239 }
4240 impl ::serde::Serialize for CreateExternalLocationRequestOwnedView {
4241 fn serialize<__S: ::serde::Serializer>(
4242 &self,
4243 __s: __S,
4244 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4245 ::serde::Serialize::serialize(&self.0, __s)
4246 }
4247 }
4248 #[derive(Clone, Debug, Default)]
4250 pub struct GetExternalLocationRequestView<'a> {
4251 pub name: &'a str,
4255 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4256 }
4257 impl<'a> GetExternalLocationRequestView<'a> {
4258 #[doc(hidden)]
4266 pub fn _decode_depth(
4267 buf: &'a [u8],
4268 depth: u32,
4269 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4270 let mut view = Self::default();
4271 view._merge_into_view(buf, depth)?;
4272 ::core::result::Result::Ok(view)
4273 }
4274 #[doc(hidden)]
4282 pub fn _merge_into_view(
4283 &mut self,
4284 buf: &'a [u8],
4285 depth: u32,
4286 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4287 let _ = depth;
4288 #[allow(unused_variables)]
4289 let view = self;
4290 let mut cur: &'a [u8] = buf;
4291 while !cur.is_empty() {
4292 let before_tag = cur;
4293 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
4294 match tag.field_number() {
4295 1u32 => {
4296 if tag.wire_type()
4297 != ::buffa::encoding::WireType::LengthDelimited
4298 {
4299 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4300 field_number: 1u32,
4301 expected: 2u8,
4302 actual: tag.wire_type() as u8,
4303 });
4304 }
4305 view.name = ::buffa::types::borrow_str(&mut cur)?;
4306 }
4307 _ => {
4308 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4309 let span_len = before_tag.len() - cur.len();
4310 view.__buffa_unknown_fields
4311 .push_raw(&before_tag[..span_len]);
4312 }
4313 }
4314 }
4315 ::core::result::Result::Ok(())
4316 }
4317 }
4318 impl<'a> ::buffa::MessageView<'a> for GetExternalLocationRequestView<'a> {
4319 type Owned = super::super::GetExternalLocationRequest;
4320 fn decode_view(
4321 buf: &'a [u8],
4322 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4323 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
4324 }
4325 fn decode_view_with_limit(
4326 buf: &'a [u8],
4327 depth: u32,
4328 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4329 Self::_decode_depth(buf, depth)
4330 }
4331 fn to_owned_message(&self) -> super::super::GetExternalLocationRequest {
4332 self.to_owned_from_source(None)
4333 }
4334 #[allow(clippy::useless_conversion, clippy::needless_update)]
4335 fn to_owned_from_source(
4336 &self,
4337 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4338 ) -> super::super::GetExternalLocationRequest {
4339 #[allow(unused_imports)]
4340 use ::buffa::alloc::string::ToString as _;
4341 let _ = __buffa_src;
4342 super::super::GetExternalLocationRequest {
4343 name: self.name.to_string(),
4344 __buffa_unknown_fields: self
4345 .__buffa_unknown_fields
4346 .to_owned()
4347 .unwrap_or_default()
4348 .into(),
4349 ..::core::default::Default::default()
4350 }
4351 }
4352 }
4353 impl<'a> ::buffa::ViewEncode<'a> for GetExternalLocationRequestView<'a> {
4354 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4355 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
4356 #[allow(unused_imports)]
4357 use ::buffa::Enumeration as _;
4358 let mut size = 0u32;
4359 if !self.name.is_empty() {
4360 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
4361 }
4362 size += self.__buffa_unknown_fields.encoded_len() as u32;
4363 size
4364 }
4365 #[allow(clippy::needless_borrow)]
4366 fn write_to(
4367 &self,
4368 _cache: &mut ::buffa::SizeCache,
4369 buf: &mut impl ::buffa::bytes::BufMut,
4370 ) {
4371 #[allow(unused_imports)]
4372 use ::buffa::Enumeration as _;
4373 if !self.name.is_empty() {
4374 ::buffa::encoding::Tag::new(
4375 1u32,
4376 ::buffa::encoding::WireType::LengthDelimited,
4377 )
4378 .encode(buf);
4379 ::buffa::types::encode_string(&self.name, buf);
4380 }
4381 self.__buffa_unknown_fields.write_to(buf);
4382 }
4383 }
4384 impl<'__a> ::serde::Serialize for GetExternalLocationRequestView<'__a> {
4396 fn serialize<__S: ::serde::Serializer>(
4397 &self,
4398 __s: __S,
4399 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4400 use ::serde::ser::SerializeMap as _;
4401 let mut __map = __s.serialize_map(::core::option::Option::None)?;
4402 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
4403 __map.serialize_entry("name", self.name)?;
4404 }
4405 __map.end()
4406 }
4407 }
4408 impl<'a> ::buffa::MessageName for GetExternalLocationRequestView<'a> {
4409 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
4410 const NAME: &'static str = "GetExternalLocationRequest";
4411 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.GetExternalLocationRequest";
4412 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.GetExternalLocationRequest";
4413 }
4414 impl<'v> ::buffa::DefaultViewInstance for GetExternalLocationRequestView<'v> {
4415 fn default_view_instance<'a>() -> &'a Self
4416 where
4417 Self: 'a,
4418 {
4419 static VALUE: ::buffa::__private::OnceBox<
4420 GetExternalLocationRequestView<'static>,
4421 > = ::buffa::__private::OnceBox::new();
4422 VALUE
4423 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
4424 <GetExternalLocationRequestView<'static>>::default(),
4425 ))
4426 }
4427 }
4428 impl ::buffa::ViewReborrow for GetExternalLocationRequestView<'static> {
4429 type Reborrowed<'b> = GetExternalLocationRequestView<'b>;
4430 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
4431 this
4432 }
4433 }
4434 #[derive(Clone, Debug)]
4440 pub struct GetExternalLocationRequestOwnedView(
4441 ::buffa::OwnedView<GetExternalLocationRequestView<'static>>,
4442 );
4443 impl GetExternalLocationRequestOwnedView {
4444 pub fn decode(
4454 bytes: ::buffa::bytes::Bytes,
4455 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4456 ::core::result::Result::Ok(
4457 GetExternalLocationRequestOwnedView(
4458 ::buffa::OwnedView::decode(bytes)?,
4459 ),
4460 )
4461 }
4462 pub fn decode_with_options(
4470 bytes: ::buffa::bytes::Bytes,
4471 opts: &::buffa::DecodeOptions,
4472 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4473 ::core::result::Result::Ok(
4474 GetExternalLocationRequestOwnedView(
4475 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
4476 ),
4477 )
4478 }
4479 pub fn from_owned(
4486 msg: &super::super::GetExternalLocationRequest,
4487 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4488 ::core::result::Result::Ok(
4489 GetExternalLocationRequestOwnedView(
4490 ::buffa::OwnedView::from_owned(msg)?,
4491 ),
4492 )
4493 }
4494 #[must_use]
4496 pub fn view(&self) -> &GetExternalLocationRequestView<'_> {
4497 self.0.reborrow()
4498 }
4499 #[must_use]
4501 pub fn to_owned_message(&self) -> super::super::GetExternalLocationRequest {
4502 self.0.to_owned_message()
4503 }
4504 #[must_use]
4506 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
4507 self.0.bytes()
4508 }
4509 #[must_use]
4511 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
4512 self.0.into_bytes()
4513 }
4514 #[must_use]
4518 pub fn name(&self) -> &'_ str {
4519 self.0.reborrow().name
4520 }
4521 }
4522 impl ::core::convert::From<
4523 ::buffa::OwnedView<GetExternalLocationRequestView<'static>>,
4524 > for GetExternalLocationRequestOwnedView {
4525 fn from(
4526 inner: ::buffa::OwnedView<GetExternalLocationRequestView<'static>>,
4527 ) -> Self {
4528 GetExternalLocationRequestOwnedView(inner)
4529 }
4530 }
4531 impl ::core::convert::From<GetExternalLocationRequestOwnedView>
4532 for ::buffa::OwnedView<GetExternalLocationRequestView<'static>> {
4533 fn from(wrapper: GetExternalLocationRequestOwnedView) -> Self {
4534 wrapper.0
4535 }
4536 }
4537 impl ::core::convert::AsRef<
4538 ::buffa::OwnedView<GetExternalLocationRequestView<'static>>,
4539 > for GetExternalLocationRequestOwnedView {
4540 fn as_ref(
4541 &self,
4542 ) -> &::buffa::OwnedView<GetExternalLocationRequestView<'static>> {
4543 &self.0
4544 }
4545 }
4546 impl ::buffa::HasMessageView for super::super::GetExternalLocationRequest {
4547 type View<'a> = GetExternalLocationRequestView<'a>;
4548 type ViewHandle = GetExternalLocationRequestOwnedView;
4549 }
4550 impl ::serde::Serialize for GetExternalLocationRequestOwnedView {
4551 fn serialize<__S: ::serde::Serializer>(
4552 &self,
4553 __s: __S,
4554 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4555 ::serde::Serialize::serialize(&self.0, __s)
4556 }
4557 }
4558 #[derive(Clone, Debug, Default)]
4560 pub struct UpdateExternalLocationRequestView<'a> {
4561 pub name: &'a str,
4565 pub url: ::core::option::Option<&'a str>,
4569 pub credential_name: ::core::option::Option<&'a str>,
4573 pub read_only: ::core::option::Option<bool>,
4577 pub owner: ::core::option::Option<&'a str>,
4581 pub comment: ::core::option::Option<&'a str>,
4585 pub new_name: ::core::option::Option<&'a str>,
4589 pub force: ::core::option::Option<bool>,
4593 pub skip_validation: ::core::option::Option<bool>,
4597 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
4598 }
4599 impl<'a> UpdateExternalLocationRequestView<'a> {
4600 #[doc(hidden)]
4608 pub fn _decode_depth(
4609 buf: &'a [u8],
4610 depth: u32,
4611 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4612 let mut view = Self::default();
4613 view._merge_into_view(buf, depth)?;
4614 ::core::result::Result::Ok(view)
4615 }
4616 #[doc(hidden)]
4624 pub fn _merge_into_view(
4625 &mut self,
4626 buf: &'a [u8],
4627 depth: u32,
4628 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
4629 let _ = depth;
4630 #[allow(unused_variables)]
4631 let view = self;
4632 let mut cur: &'a [u8] = buf;
4633 while !cur.is_empty() {
4634 let before_tag = cur;
4635 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
4636 match tag.field_number() {
4637 1u32 => {
4638 if tag.wire_type()
4639 != ::buffa::encoding::WireType::LengthDelimited
4640 {
4641 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4642 field_number: 1u32,
4643 expected: 2u8,
4644 actual: tag.wire_type() as u8,
4645 });
4646 }
4647 view.name = ::buffa::types::borrow_str(&mut cur)?;
4648 }
4649 2u32 => {
4650 if tag.wire_type()
4651 != ::buffa::encoding::WireType::LengthDelimited
4652 {
4653 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4654 field_number: 2u32,
4655 expected: 2u8,
4656 actual: tag.wire_type() as u8,
4657 });
4658 }
4659 view.url = Some(::buffa::types::borrow_str(&mut cur)?);
4660 }
4661 3u32 => {
4662 if tag.wire_type()
4663 != ::buffa::encoding::WireType::LengthDelimited
4664 {
4665 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4666 field_number: 3u32,
4667 expected: 2u8,
4668 actual: tag.wire_type() as u8,
4669 });
4670 }
4671 view.credential_name = Some(
4672 ::buffa::types::borrow_str(&mut cur)?,
4673 );
4674 }
4675 4u32 => {
4676 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4677 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4678 field_number: 4u32,
4679 expected: 0u8,
4680 actual: tag.wire_type() as u8,
4681 });
4682 }
4683 view.read_only = Some(
4684 ::buffa::types::decode_bool(&mut cur)?,
4685 );
4686 }
4687 5u32 => {
4688 if tag.wire_type()
4689 != ::buffa::encoding::WireType::LengthDelimited
4690 {
4691 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4692 field_number: 5u32,
4693 expected: 2u8,
4694 actual: tag.wire_type() as u8,
4695 });
4696 }
4697 view.owner = Some(::buffa::types::borrow_str(&mut cur)?);
4698 }
4699 6u32 => {
4700 if tag.wire_type()
4701 != ::buffa::encoding::WireType::LengthDelimited
4702 {
4703 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4704 field_number: 6u32,
4705 expected: 2u8,
4706 actual: tag.wire_type() as u8,
4707 });
4708 }
4709 view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
4710 }
4711 7u32 => {
4712 if tag.wire_type()
4713 != ::buffa::encoding::WireType::LengthDelimited
4714 {
4715 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4716 field_number: 7u32,
4717 expected: 2u8,
4718 actual: tag.wire_type() as u8,
4719 });
4720 }
4721 view.new_name = Some(::buffa::types::borrow_str(&mut cur)?);
4722 }
4723 8u32 => {
4724 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4725 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4726 field_number: 8u32,
4727 expected: 0u8,
4728 actual: tag.wire_type() as u8,
4729 });
4730 }
4731 view.force = Some(::buffa::types::decode_bool(&mut cur)?);
4732 }
4733 9u32 => {
4734 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
4735 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
4736 field_number: 9u32,
4737 expected: 0u8,
4738 actual: tag.wire_type() as u8,
4739 });
4740 }
4741 view.skip_validation = Some(
4742 ::buffa::types::decode_bool(&mut cur)?,
4743 );
4744 }
4745 _ => {
4746 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
4747 let span_len = before_tag.len() - cur.len();
4748 view.__buffa_unknown_fields
4749 .push_raw(&before_tag[..span_len]);
4750 }
4751 }
4752 }
4753 ::core::result::Result::Ok(())
4754 }
4755 }
4756 impl<'a> ::buffa::MessageView<'a> for UpdateExternalLocationRequestView<'a> {
4757 type Owned = super::super::UpdateExternalLocationRequest;
4758 fn decode_view(
4759 buf: &'a [u8],
4760 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4761 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
4762 }
4763 fn decode_view_with_limit(
4764 buf: &'a [u8],
4765 depth: u32,
4766 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
4767 Self::_decode_depth(buf, depth)
4768 }
4769 fn to_owned_message(&self) -> super::super::UpdateExternalLocationRequest {
4770 self.to_owned_from_source(None)
4771 }
4772 #[allow(clippy::useless_conversion, clippy::needless_update)]
4773 fn to_owned_from_source(
4774 &self,
4775 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
4776 ) -> super::super::UpdateExternalLocationRequest {
4777 #[allow(unused_imports)]
4778 use ::buffa::alloc::string::ToString as _;
4779 let _ = __buffa_src;
4780 super::super::UpdateExternalLocationRequest {
4781 name: self.name.to_string(),
4782 url: self.url.map(|s| s.to_string()),
4783 credential_name: self.credential_name.map(|s| s.to_string()),
4784 read_only: self.read_only,
4785 owner: self.owner.map(|s| s.to_string()),
4786 comment: self.comment.map(|s| s.to_string()),
4787 new_name: self.new_name.map(|s| s.to_string()),
4788 force: self.force,
4789 skip_validation: self.skip_validation,
4790 __buffa_unknown_fields: self
4791 .__buffa_unknown_fields
4792 .to_owned()
4793 .unwrap_or_default()
4794 .into(),
4795 ..::core::default::Default::default()
4796 }
4797 }
4798 }
4799 impl<'a> ::buffa::ViewEncode<'a> for UpdateExternalLocationRequestView<'a> {
4800 #[allow(clippy::needless_borrow, clippy::let_and_return)]
4801 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
4802 #[allow(unused_imports)]
4803 use ::buffa::Enumeration as _;
4804 let mut size = 0u32;
4805 if !self.name.is_empty() {
4806 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
4807 }
4808 if let Some(ref v) = self.url {
4809 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4810 }
4811 if let Some(ref v) = self.credential_name {
4812 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4813 }
4814 if self.read_only.is_some() {
4815 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
4816 }
4817 if let Some(ref v) = self.owner {
4818 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4819 }
4820 if let Some(ref v) = self.comment {
4821 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4822 }
4823 if let Some(ref v) = self.new_name {
4824 size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
4825 }
4826 if self.force.is_some() {
4827 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
4828 }
4829 if self.skip_validation.is_some() {
4830 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
4831 }
4832 size += self.__buffa_unknown_fields.encoded_len() as u32;
4833 size
4834 }
4835 #[allow(clippy::needless_borrow)]
4836 fn write_to(
4837 &self,
4838 _cache: &mut ::buffa::SizeCache,
4839 buf: &mut impl ::buffa::bytes::BufMut,
4840 ) {
4841 #[allow(unused_imports)]
4842 use ::buffa::Enumeration as _;
4843 if !self.name.is_empty() {
4844 ::buffa::encoding::Tag::new(
4845 1u32,
4846 ::buffa::encoding::WireType::LengthDelimited,
4847 )
4848 .encode(buf);
4849 ::buffa::types::encode_string(&self.name, buf);
4850 }
4851 if let Some(ref v) = self.url {
4852 ::buffa::encoding::Tag::new(
4853 2u32,
4854 ::buffa::encoding::WireType::LengthDelimited,
4855 )
4856 .encode(buf);
4857 ::buffa::types::encode_string(v, buf);
4858 }
4859 if let Some(ref v) = self.credential_name {
4860 ::buffa::encoding::Tag::new(
4861 3u32,
4862 ::buffa::encoding::WireType::LengthDelimited,
4863 )
4864 .encode(buf);
4865 ::buffa::types::encode_string(v, buf);
4866 }
4867 if let Some(v) = self.read_only {
4868 ::buffa::encoding::Tag::new(
4869 4u32,
4870 ::buffa::encoding::WireType::Varint,
4871 )
4872 .encode(buf);
4873 ::buffa::types::encode_bool(v, buf);
4874 }
4875 if let Some(ref v) = self.owner {
4876 ::buffa::encoding::Tag::new(
4877 5u32,
4878 ::buffa::encoding::WireType::LengthDelimited,
4879 )
4880 .encode(buf);
4881 ::buffa::types::encode_string(v, buf);
4882 }
4883 if let Some(ref v) = self.comment {
4884 ::buffa::encoding::Tag::new(
4885 6u32,
4886 ::buffa::encoding::WireType::LengthDelimited,
4887 )
4888 .encode(buf);
4889 ::buffa::types::encode_string(v, buf);
4890 }
4891 if let Some(ref v) = self.new_name {
4892 ::buffa::encoding::Tag::new(
4893 7u32,
4894 ::buffa::encoding::WireType::LengthDelimited,
4895 )
4896 .encode(buf);
4897 ::buffa::types::encode_string(v, buf);
4898 }
4899 if let Some(v) = self.force {
4900 ::buffa::encoding::Tag::new(
4901 8u32,
4902 ::buffa::encoding::WireType::Varint,
4903 )
4904 .encode(buf);
4905 ::buffa::types::encode_bool(v, buf);
4906 }
4907 if let Some(v) = self.skip_validation {
4908 ::buffa::encoding::Tag::new(
4909 9u32,
4910 ::buffa::encoding::WireType::Varint,
4911 )
4912 .encode(buf);
4913 ::buffa::types::encode_bool(v, buf);
4914 }
4915 self.__buffa_unknown_fields.write_to(buf);
4916 }
4917 }
4918 impl<'__a> ::serde::Serialize for UpdateExternalLocationRequestView<'__a> {
4930 fn serialize<__S: ::serde::Serializer>(
4931 &self,
4932 __s: __S,
4933 ) -> ::core::result::Result<__S::Ok, __S::Error> {
4934 use ::serde::ser::SerializeMap as _;
4935 let mut __map = __s.serialize_map(::core::option::Option::None)?;
4936 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
4937 __map.serialize_entry("name", self.name)?;
4938 }
4939 if let ::core::option::Option::Some(__v) = self.url {
4940 __map.serialize_entry("url", __v)?;
4941 }
4942 if let ::core::option::Option::Some(__v) = self.credential_name {
4943 __map.serialize_entry("credential_name", __v)?;
4944 }
4945 if let ::core::option::Option::Some(__v) = self.read_only {
4946 __map.serialize_entry("read_only", &__v)?;
4947 }
4948 if let ::core::option::Option::Some(__v) = self.owner {
4949 __map.serialize_entry("owner", __v)?;
4950 }
4951 if let ::core::option::Option::Some(__v) = self.comment {
4952 __map.serialize_entry("comment", __v)?;
4953 }
4954 if let ::core::option::Option::Some(__v) = self.new_name {
4955 __map.serialize_entry("new_name", __v)?;
4956 }
4957 if let ::core::option::Option::Some(__v) = self.force {
4958 __map.serialize_entry("force", &__v)?;
4959 }
4960 if let ::core::option::Option::Some(__v) = self.skip_validation {
4961 __map.serialize_entry("skip_validation", &__v)?;
4962 }
4963 __map.end()
4964 }
4965 }
4966 impl<'a> ::buffa::MessageName for UpdateExternalLocationRequestView<'a> {
4967 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
4968 const NAME: &'static str = "UpdateExternalLocationRequest";
4969 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.UpdateExternalLocationRequest";
4970 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.UpdateExternalLocationRequest";
4971 }
4972 impl<'v> ::buffa::DefaultViewInstance for UpdateExternalLocationRequestView<'v> {
4973 fn default_view_instance<'a>() -> &'a Self
4974 where
4975 Self: 'a,
4976 {
4977 static VALUE: ::buffa::__private::OnceBox<
4978 UpdateExternalLocationRequestView<'static>,
4979 > = ::buffa::__private::OnceBox::new();
4980 VALUE
4981 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
4982 <UpdateExternalLocationRequestView<'static>>::default(),
4983 ))
4984 }
4985 }
4986 impl ::buffa::ViewReborrow for UpdateExternalLocationRequestView<'static> {
4987 type Reborrowed<'b> = UpdateExternalLocationRequestView<'b>;
4988 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
4989 this
4990 }
4991 }
4992 #[derive(Clone, Debug)]
4998 pub struct UpdateExternalLocationRequestOwnedView(
4999 ::buffa::OwnedView<UpdateExternalLocationRequestView<'static>>,
5000 );
5001 impl UpdateExternalLocationRequestOwnedView {
5002 pub fn decode(
5012 bytes: ::buffa::bytes::Bytes,
5013 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5014 ::core::result::Result::Ok(
5015 UpdateExternalLocationRequestOwnedView(
5016 ::buffa::OwnedView::decode(bytes)?,
5017 ),
5018 )
5019 }
5020 pub fn decode_with_options(
5028 bytes: ::buffa::bytes::Bytes,
5029 opts: &::buffa::DecodeOptions,
5030 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5031 ::core::result::Result::Ok(
5032 UpdateExternalLocationRequestOwnedView(
5033 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5034 ),
5035 )
5036 }
5037 pub fn from_owned(
5044 msg: &super::super::UpdateExternalLocationRequest,
5045 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5046 ::core::result::Result::Ok(
5047 UpdateExternalLocationRequestOwnedView(
5048 ::buffa::OwnedView::from_owned(msg)?,
5049 ),
5050 )
5051 }
5052 #[must_use]
5054 pub fn view(&self) -> &UpdateExternalLocationRequestView<'_> {
5055 self.0.reborrow()
5056 }
5057 #[must_use]
5059 pub fn to_owned_message(
5060 &self,
5061 ) -> super::super::UpdateExternalLocationRequest {
5062 self.0.to_owned_message()
5063 }
5064 #[must_use]
5066 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5067 self.0.bytes()
5068 }
5069 #[must_use]
5071 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5072 self.0.into_bytes()
5073 }
5074 #[must_use]
5078 pub fn name(&self) -> &'_ str {
5079 self.0.reborrow().name
5080 }
5081 #[must_use]
5085 pub fn url(&self) -> ::core::option::Option<&'_ str> {
5086 self.0.reborrow().url
5087 }
5088 #[must_use]
5092 pub fn credential_name(&self) -> ::core::option::Option<&'_ str> {
5093 self.0.reborrow().credential_name
5094 }
5095 #[must_use]
5099 pub fn read_only(&self) -> ::core::option::Option<bool> {
5100 self.0.reborrow().read_only
5101 }
5102 #[must_use]
5106 pub fn owner(&self) -> ::core::option::Option<&'_ str> {
5107 self.0.reborrow().owner
5108 }
5109 #[must_use]
5113 pub fn comment(&self) -> ::core::option::Option<&'_ str> {
5114 self.0.reborrow().comment
5115 }
5116 #[must_use]
5120 pub fn new_name(&self) -> ::core::option::Option<&'_ str> {
5121 self.0.reborrow().new_name
5122 }
5123 #[must_use]
5127 pub fn force(&self) -> ::core::option::Option<bool> {
5128 self.0.reborrow().force
5129 }
5130 #[must_use]
5134 pub fn skip_validation(&self) -> ::core::option::Option<bool> {
5135 self.0.reborrow().skip_validation
5136 }
5137 }
5138 impl ::core::convert::From<
5139 ::buffa::OwnedView<UpdateExternalLocationRequestView<'static>>,
5140 > for UpdateExternalLocationRequestOwnedView {
5141 fn from(
5142 inner: ::buffa::OwnedView<UpdateExternalLocationRequestView<'static>>,
5143 ) -> Self {
5144 UpdateExternalLocationRequestOwnedView(inner)
5145 }
5146 }
5147 impl ::core::convert::From<UpdateExternalLocationRequestOwnedView>
5148 for ::buffa::OwnedView<UpdateExternalLocationRequestView<'static>> {
5149 fn from(wrapper: UpdateExternalLocationRequestOwnedView) -> Self {
5150 wrapper.0
5151 }
5152 }
5153 impl ::core::convert::AsRef<
5154 ::buffa::OwnedView<UpdateExternalLocationRequestView<'static>>,
5155 > for UpdateExternalLocationRequestOwnedView {
5156 fn as_ref(
5157 &self,
5158 ) -> &::buffa::OwnedView<UpdateExternalLocationRequestView<'static>> {
5159 &self.0
5160 }
5161 }
5162 impl ::buffa::HasMessageView for super::super::UpdateExternalLocationRequest {
5163 type View<'a> = UpdateExternalLocationRequestView<'a>;
5164 type ViewHandle = UpdateExternalLocationRequestOwnedView;
5165 }
5166 impl ::serde::Serialize for UpdateExternalLocationRequestOwnedView {
5167 fn serialize<__S: ::serde::Serializer>(
5168 &self,
5169 __s: __S,
5170 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5171 ::serde::Serialize::serialize(&self.0, __s)
5172 }
5173 }
5174 #[derive(Clone, Debug, Default)]
5176 pub struct DeleteExternalLocationRequestView<'a> {
5177 pub name: &'a str,
5181 pub force: ::core::option::Option<bool>,
5185 pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
5186 }
5187 impl<'a> DeleteExternalLocationRequestView<'a> {
5188 #[doc(hidden)]
5196 pub fn _decode_depth(
5197 buf: &'a [u8],
5198 depth: u32,
5199 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5200 let mut view = Self::default();
5201 view._merge_into_view(buf, depth)?;
5202 ::core::result::Result::Ok(view)
5203 }
5204 #[doc(hidden)]
5212 pub fn _merge_into_view(
5213 &mut self,
5214 buf: &'a [u8],
5215 depth: u32,
5216 ) -> ::core::result::Result<(), ::buffa::DecodeError> {
5217 let _ = depth;
5218 #[allow(unused_variables)]
5219 let view = self;
5220 let mut cur: &'a [u8] = buf;
5221 while !cur.is_empty() {
5222 let before_tag = cur;
5223 let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
5224 match tag.field_number() {
5225 1u32 => {
5226 if tag.wire_type()
5227 != ::buffa::encoding::WireType::LengthDelimited
5228 {
5229 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5230 field_number: 1u32,
5231 expected: 2u8,
5232 actual: tag.wire_type() as u8,
5233 });
5234 }
5235 view.name = ::buffa::types::borrow_str(&mut cur)?;
5236 }
5237 2u32 => {
5238 if tag.wire_type() != ::buffa::encoding::WireType::Varint {
5239 return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
5240 field_number: 2u32,
5241 expected: 0u8,
5242 actual: tag.wire_type() as u8,
5243 });
5244 }
5245 view.force = Some(::buffa::types::decode_bool(&mut cur)?);
5246 }
5247 _ => {
5248 ::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
5249 let span_len = before_tag.len() - cur.len();
5250 view.__buffa_unknown_fields
5251 .push_raw(&before_tag[..span_len]);
5252 }
5253 }
5254 }
5255 ::core::result::Result::Ok(())
5256 }
5257 }
5258 impl<'a> ::buffa::MessageView<'a> for DeleteExternalLocationRequestView<'a> {
5259 type Owned = super::super::DeleteExternalLocationRequest;
5260 fn decode_view(
5261 buf: &'a [u8],
5262 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5263 Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
5264 }
5265 fn decode_view_with_limit(
5266 buf: &'a [u8],
5267 depth: u32,
5268 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5269 Self::_decode_depth(buf, depth)
5270 }
5271 fn to_owned_message(&self) -> super::super::DeleteExternalLocationRequest {
5272 self.to_owned_from_source(None)
5273 }
5274 #[allow(clippy::useless_conversion, clippy::needless_update)]
5275 fn to_owned_from_source(
5276 &self,
5277 __buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
5278 ) -> super::super::DeleteExternalLocationRequest {
5279 #[allow(unused_imports)]
5280 use ::buffa::alloc::string::ToString as _;
5281 let _ = __buffa_src;
5282 super::super::DeleteExternalLocationRequest {
5283 name: self.name.to_string(),
5284 force: self.force,
5285 __buffa_unknown_fields: self
5286 .__buffa_unknown_fields
5287 .to_owned()
5288 .unwrap_or_default()
5289 .into(),
5290 ..::core::default::Default::default()
5291 }
5292 }
5293 }
5294 impl<'a> ::buffa::ViewEncode<'a> for DeleteExternalLocationRequestView<'a> {
5295 #[allow(clippy::needless_borrow, clippy::let_and_return)]
5296 fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
5297 #[allow(unused_imports)]
5298 use ::buffa::Enumeration as _;
5299 let mut size = 0u32;
5300 if !self.name.is_empty() {
5301 size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
5302 }
5303 if self.force.is_some() {
5304 size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
5305 }
5306 size += self.__buffa_unknown_fields.encoded_len() as u32;
5307 size
5308 }
5309 #[allow(clippy::needless_borrow)]
5310 fn write_to(
5311 &self,
5312 _cache: &mut ::buffa::SizeCache,
5313 buf: &mut impl ::buffa::bytes::BufMut,
5314 ) {
5315 #[allow(unused_imports)]
5316 use ::buffa::Enumeration as _;
5317 if !self.name.is_empty() {
5318 ::buffa::encoding::Tag::new(
5319 1u32,
5320 ::buffa::encoding::WireType::LengthDelimited,
5321 )
5322 .encode(buf);
5323 ::buffa::types::encode_string(&self.name, buf);
5324 }
5325 if let Some(v) = self.force {
5326 ::buffa::encoding::Tag::new(
5327 2u32,
5328 ::buffa::encoding::WireType::Varint,
5329 )
5330 .encode(buf);
5331 ::buffa::types::encode_bool(v, buf);
5332 }
5333 self.__buffa_unknown_fields.write_to(buf);
5334 }
5335 }
5336 impl<'__a> ::serde::Serialize for DeleteExternalLocationRequestView<'__a> {
5348 fn serialize<__S: ::serde::Serializer>(
5349 &self,
5350 __s: __S,
5351 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5352 use ::serde::ser::SerializeMap as _;
5353 let mut __map = __s.serialize_map(::core::option::Option::None)?;
5354 if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
5355 __map.serialize_entry("name", self.name)?;
5356 }
5357 if let ::core::option::Option::Some(__v) = self.force {
5358 __map.serialize_entry("force", &__v)?;
5359 }
5360 __map.end()
5361 }
5362 }
5363 impl<'a> ::buffa::MessageName for DeleteExternalLocationRequestView<'a> {
5364 const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
5365 const NAME: &'static str = "DeleteExternalLocationRequest";
5366 const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.DeleteExternalLocationRequest";
5367 const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.DeleteExternalLocationRequest";
5368 }
5369 impl<'v> ::buffa::DefaultViewInstance for DeleteExternalLocationRequestView<'v> {
5370 fn default_view_instance<'a>() -> &'a Self
5371 where
5372 Self: 'a,
5373 {
5374 static VALUE: ::buffa::__private::OnceBox<
5375 DeleteExternalLocationRequestView<'static>,
5376 > = ::buffa::__private::OnceBox::new();
5377 VALUE
5378 .get_or_init(|| ::buffa::alloc::boxed::Box::new(
5379 <DeleteExternalLocationRequestView<'static>>::default(),
5380 ))
5381 }
5382 }
5383 impl ::buffa::ViewReborrow for DeleteExternalLocationRequestView<'static> {
5384 type Reborrowed<'b> = DeleteExternalLocationRequestView<'b>;
5385 fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
5386 this
5387 }
5388 }
5389 #[derive(Clone, Debug)]
5395 pub struct DeleteExternalLocationRequestOwnedView(
5396 ::buffa::OwnedView<DeleteExternalLocationRequestView<'static>>,
5397 );
5398 impl DeleteExternalLocationRequestOwnedView {
5399 pub fn decode(
5409 bytes: ::buffa::bytes::Bytes,
5410 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5411 ::core::result::Result::Ok(
5412 DeleteExternalLocationRequestOwnedView(
5413 ::buffa::OwnedView::decode(bytes)?,
5414 ),
5415 )
5416 }
5417 pub fn decode_with_options(
5425 bytes: ::buffa::bytes::Bytes,
5426 opts: &::buffa::DecodeOptions,
5427 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5428 ::core::result::Result::Ok(
5429 DeleteExternalLocationRequestOwnedView(
5430 ::buffa::OwnedView::decode_with_options(bytes, opts)?,
5431 ),
5432 )
5433 }
5434 pub fn from_owned(
5441 msg: &super::super::DeleteExternalLocationRequest,
5442 ) -> ::core::result::Result<Self, ::buffa::DecodeError> {
5443 ::core::result::Result::Ok(
5444 DeleteExternalLocationRequestOwnedView(
5445 ::buffa::OwnedView::from_owned(msg)?,
5446 ),
5447 )
5448 }
5449 #[must_use]
5451 pub fn view(&self) -> &DeleteExternalLocationRequestView<'_> {
5452 self.0.reborrow()
5453 }
5454 #[must_use]
5456 pub fn to_owned_message(
5457 &self,
5458 ) -> super::super::DeleteExternalLocationRequest {
5459 self.0.to_owned_message()
5460 }
5461 #[must_use]
5463 pub fn bytes(&self) -> &::buffa::bytes::Bytes {
5464 self.0.bytes()
5465 }
5466 #[must_use]
5468 pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
5469 self.0.into_bytes()
5470 }
5471 #[must_use]
5475 pub fn name(&self) -> &'_ str {
5476 self.0.reborrow().name
5477 }
5478 #[must_use]
5482 pub fn force(&self) -> ::core::option::Option<bool> {
5483 self.0.reborrow().force
5484 }
5485 }
5486 impl ::core::convert::From<
5487 ::buffa::OwnedView<DeleteExternalLocationRequestView<'static>>,
5488 > for DeleteExternalLocationRequestOwnedView {
5489 fn from(
5490 inner: ::buffa::OwnedView<DeleteExternalLocationRequestView<'static>>,
5491 ) -> Self {
5492 DeleteExternalLocationRequestOwnedView(inner)
5493 }
5494 }
5495 impl ::core::convert::From<DeleteExternalLocationRequestOwnedView>
5496 for ::buffa::OwnedView<DeleteExternalLocationRequestView<'static>> {
5497 fn from(wrapper: DeleteExternalLocationRequestOwnedView) -> Self {
5498 wrapper.0
5499 }
5500 }
5501 impl ::core::convert::AsRef<
5502 ::buffa::OwnedView<DeleteExternalLocationRequestView<'static>>,
5503 > for DeleteExternalLocationRequestOwnedView {
5504 fn as_ref(
5505 &self,
5506 ) -> &::buffa::OwnedView<DeleteExternalLocationRequestView<'static>> {
5507 &self.0
5508 }
5509 }
5510 impl ::buffa::HasMessageView for super::super::DeleteExternalLocationRequest {
5511 type View<'a> = DeleteExternalLocationRequestView<'a>;
5512 type ViewHandle = DeleteExternalLocationRequestOwnedView;
5513 }
5514 impl ::serde::Serialize for DeleteExternalLocationRequestOwnedView {
5515 fn serialize<__S: ::serde::Serializer>(
5516 &self,
5517 __s: __S,
5518 ) -> ::core::result::Result<__S::Ok, __S::Error> {
5519 ::serde::Serialize::serialize(&self.0, __s)
5520 }
5521 }
5522 }
5523 pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
5525 reg.register_json_any(super::__EXTERNAL_LOCATION_JSON_ANY);
5526 reg.register_json_any(super::__LIST_EXTERNAL_LOCATIONS_REQUEST_JSON_ANY);
5527 reg.register_json_any(super::__LIST_EXTERNAL_LOCATIONS_RESPONSE_JSON_ANY);
5528 reg.register_json_any(super::__CREATE_EXTERNAL_LOCATION_REQUEST_JSON_ANY);
5529 reg.register_json_any(super::__GET_EXTERNAL_LOCATION_REQUEST_JSON_ANY);
5530 reg.register_json_any(super::__UPDATE_EXTERNAL_LOCATION_REQUEST_JSON_ANY);
5531 reg.register_json_any(super::__DELETE_EXTERNAL_LOCATION_REQUEST_JSON_ANY);
5532 }
5533}
5534#[doc(inline)]
5535pub use self::__buffa::view::ExternalLocationView;
5536#[doc(inline)]
5537pub use self::__buffa::view::ExternalLocationOwnedView;
5538#[doc(inline)]
5539pub use self::__buffa::view::ListExternalLocationsRequestView;
5540#[doc(inline)]
5541pub use self::__buffa::view::ListExternalLocationsRequestOwnedView;
5542#[doc(inline)]
5543pub use self::__buffa::view::ListExternalLocationsResponseView;
5544#[doc(inline)]
5545pub use self::__buffa::view::ListExternalLocationsResponseOwnedView;
5546#[doc(inline)]
5547pub use self::__buffa::view::CreateExternalLocationRequestView;
5548#[doc(inline)]
5549pub use self::__buffa::view::CreateExternalLocationRequestOwnedView;
5550#[doc(inline)]
5551pub use self::__buffa::view::GetExternalLocationRequestView;
5552#[doc(inline)]
5553pub use self::__buffa::view::GetExternalLocationRequestOwnedView;
5554#[doc(inline)]
5555pub use self::__buffa::view::UpdateExternalLocationRequestView;
5556#[doc(inline)]
5557pub use self::__buffa::view::UpdateExternalLocationRequestOwnedView;
5558#[doc(inline)]
5559pub use self::__buffa::view::DeleteExternalLocationRequestView;
5560#[doc(inline)]
5561pub use self::__buffa::view::DeleteExternalLocationRequestOwnedView;
5562#[doc(inline)]
5563pub use self::__buffa::register_types;