#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct ExternalLocation {
#[serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub name: ::buffa::alloc::string::String,
#[serde(
rename = "url",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub url: ::buffa::alloc::string::String,
#[serde(
rename = "credential_name",
alias = "credentialName",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub credential_name: ::buffa::alloc::string::String,
#[serde(
rename = "read_only",
alias = "readOnly",
with = "::buffa::json_helpers::proto_bool",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_false"
)]
pub read_only: bool,
#[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
pub comment: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(rename = "owner", skip_serializing_if = "::core::option::Option::is_none")]
pub owner: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(
rename = "credential_id",
alias = "credentialId",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub credential_id: ::buffa::alloc::string::String,
#[serde(
rename = "created_at",
alias = "createdAt",
with = "::buffa::json_helpers::opt_int64",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub created_at: ::core::option::Option<i64>,
#[serde(
rename = "created_by",
alias = "createdBy",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub created_by: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(
rename = "updated_at",
alias = "updatedAt",
with = "::buffa::json_helpers::opt_int64",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub updated_at: ::core::option::Option<i64>,
#[serde(
rename = "updated_by",
alias = "updatedBy",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub updated_by: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(
rename = "browse_only",
alias = "browseOnly",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub browse_only: ::core::option::Option<bool>,
#[serde(
rename = "external_location_id",
alias = "externalLocationId",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub external_location_id: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ExternalLocation {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ExternalLocation")
.field("name", &self.name)
.field("url", &self.url)
.field("credential_name", &self.credential_name)
.field("read_only", &self.read_only)
.field("comment", &self.comment)
.field("owner", &self.owner)
.field("credential_id", &self.credential_id)
.field("created_at", &self.created_at)
.field("created_by", &self.created_by)
.field("updated_at", &self.updated_at)
.field("updated_by", &self.updated_by)
.field("browse_only", &self.browse_only)
.field("external_location_id", &self.external_location_id)
.finish()
}
}
impl ExternalLocation {
pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ExternalLocation";
}
impl ExternalLocation {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_comment(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.comment = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_owner(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.owner = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_created_at(mut self, value: i64) -> Self {
self.created_at = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_created_by(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.created_by = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_updated_at(mut self, value: i64) -> Self {
self.updated_at = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_updated_by(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.updated_by = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_browse_only(mut self, value: bool) -> Self {
self.browse_only = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_external_location_id(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.external_location_id = Some(value.into());
self
}
}
impl ::buffa::DefaultInstance for ExternalLocation {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ExternalLocation> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ExternalLocation {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "ExternalLocation";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.ExternalLocation";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ExternalLocation";
}
impl ::buffa::Message for ExternalLocation {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if !self.url.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.url) as u32;
}
if !self.credential_name.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.credential_name) as u32;
}
if self.read_only {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if let Some(ref v) = self.comment {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.owner {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if !self.credential_id.is_empty() {
size
+= 1u32 + ::buffa::types::string_encoded_len(&self.credential_id) as u32;
}
if let Some(v) = self.created_at {
size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
}
if let Some(ref v) = self.created_by {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(v) = self.updated_at {
size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
}
if let Some(ref v) = self.updated_by {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.browse_only.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if let Some(ref v) = self.external_location_id {
size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if !self.url.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.url, buf);
}
if !self.credential_name.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.credential_name, buf);
}
if self.read_only {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(self.read_only, buf);
}
if let Some(ref v) = self.comment {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.owner {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if !self.credential_id.is_empty() {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.credential_id, buf);
}
if let Some(v) = self.created_at {
::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(v, buf);
}
if let Some(ref v) = self.created_by {
::buffa::encoding::Tag::new(
10u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.updated_at {
::buffa::encoding::Tag::new(11u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int64(v, buf);
}
if let Some(ref v) = self.updated_by {
::buffa::encoding::Tag::new(
12u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.browse_only {
::buffa::encoding::Tag::new(13u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(ref v) = self.external_location_id {
::buffa::encoding::Tag::new(
100u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(&mut self.name, buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(&mut self.url, buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(&mut self.credential_name, buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.read_only = ::buffa::types::decode_bool(buf)?;
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self.owner.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(&mut self.credential_id, buf)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.created_at = ::core::option::Option::Some(
::buffa::types::decode_int64(buf)?,
);
}
10u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.created_by
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.updated_at = ::core::option::Option::Some(
::buffa::types::decode_int64(buf)?,
);
}
12u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.updated_by
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
13u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 13u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.browse_only = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
100u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 100u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.external_location_id
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name.clear();
self.url.clear();
self.credential_name.clear();
self.read_only = false;
self.comment = ::core::option::Option::None;
self.owner = ::core::option::Option::None;
self.credential_id.clear();
self.created_at = ::core::option::Option::None;
self.created_by = ::core::option::Option::None;
self.updated_at = ::core::option::Option::None;
self.updated_by = ::core::option::Option::None;
self.browse_only = ::core::option::Option::None;
self.external_location_id = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ExternalLocation {
const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.ExternalLocation";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for ExternalLocation {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __EXTERNAL_LOCATION_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/unitycatalog.external_locations.v1.ExternalLocation",
to_json: ::buffa::type_registry::any_to_json::<ExternalLocation>,
from_json: ::buffa::type_registry::any_from_json::<ExternalLocation>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct ListExternalLocationsRequest {
#[serde(
rename = "max_results",
alias = "maxResults",
with = "::buffa::json_helpers::opt_int32",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub max_results: ::core::option::Option<i32>,
#[serde(
rename = "page_token",
alias = "pageToken",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub page_token: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(
rename = "include_browse",
alias = "includeBrowse",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub include_browse: ::core::option::Option<bool>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ListExternalLocationsRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ListExternalLocationsRequest")
.field("max_results", &self.max_results)
.field("page_token", &self.page_token)
.field("include_browse", &self.include_browse)
.finish()
}
}
impl ListExternalLocationsRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsRequest";
}
impl ListExternalLocationsRequest {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_max_results(mut self, value: i32) -> Self {
self.max_results = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_page_token(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.page_token = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_include_browse(mut self, value: bool) -> Self {
self.include_browse = Some(value);
self
}
}
impl ::buffa::DefaultInstance for ListExternalLocationsRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ListExternalLocationsRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ListExternalLocationsRequest {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "ListExternalLocationsRequest";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.ListExternalLocationsRequest";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsRequest";
}
impl ::buffa::Message for ListExternalLocationsRequest {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(v) = self.max_results {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(ref v) = self.page_token {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.include_browse.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(v) = self.max_results {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(ref v) = self.page_token {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.include_browse {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.max_results = ::core::option::Option::Some(
::buffa::types::decode_int32(buf)?,
);
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.page_token
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.include_browse = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.max_results = ::core::option::Option::None;
self.page_token = ::core::option::Option::None;
self.include_browse = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ListExternalLocationsRequest {
const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.ListExternalLocationsRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for ListExternalLocationsRequest {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __LIST_EXTERNAL_LOCATIONS_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsRequest",
to_json: ::buffa::type_registry::any_to_json::<ListExternalLocationsRequest>,
from_json: ::buffa::type_registry::any_from_json::<ListExternalLocationsRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct ListExternalLocationsResponse {
#[serde(
rename = "external_locations",
alias = "externalLocations",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_vec",
deserialize_with = "::buffa::json_helpers::null_as_default"
)]
pub external_locations: ::buffa::alloc::vec::Vec<ExternalLocation>,
#[serde(
rename = "next_page_token",
alias = "nextPageToken",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub next_page_token: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for ListExternalLocationsResponse {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("ListExternalLocationsResponse")
.field("external_locations", &self.external_locations)
.field("next_page_token", &self.next_page_token)
.finish()
}
}
impl ListExternalLocationsResponse {
pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsResponse";
}
impl ListExternalLocationsResponse {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_next_page_token(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.next_page_token = Some(value.into());
self
}
}
impl ::buffa::DefaultInstance for ListExternalLocationsResponse {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<ListExternalLocationsResponse> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for ListExternalLocationsResponse {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "ListExternalLocationsResponse";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.ListExternalLocationsResponse";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsResponse";
}
impl ::buffa::Message for ListExternalLocationsResponse {
#[allow(clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
for v in &self.external_locations {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if let Some(ref v) = self.next_page_token {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.external_locations {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if let Some(ref v) = self.next_page_token {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
let mut elem = ::core::default::Default::default();
::buffa::Message::merge_length_delimited(&mut elem, buf, depth)?;
self.external_locations.push(elem);
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.next_page_token
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.external_locations.clear();
self.next_page_token = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for ListExternalLocationsResponse {
const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.ListExternalLocationsResponse";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for ListExternalLocationsResponse {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __LIST_EXTERNAL_LOCATIONS_RESPONSE_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsResponse",
to_json: ::buffa::type_registry::any_to_json::<ListExternalLocationsResponse>,
from_json: ::buffa::type_registry::any_from_json::<ListExternalLocationsResponse>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct CreateExternalLocationRequest {
#[serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub name: ::buffa::alloc::string::String,
#[serde(
rename = "url",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub url: ::buffa::alloc::string::String,
#[serde(
rename = "credential_name",
alias = "credentialName",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub credential_name: ::buffa::alloc::string::String,
#[serde(
rename = "read_only",
alias = "readOnly",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub read_only: ::core::option::Option<bool>,
#[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
pub comment: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(
rename = "skip_validation",
alias = "skipValidation",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub skip_validation: ::core::option::Option<bool>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for CreateExternalLocationRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("CreateExternalLocationRequest")
.field("name", &self.name)
.field("url", &self.url)
.field("credential_name", &self.credential_name)
.field("read_only", &self.read_only)
.field("comment", &self.comment)
.field("skip_validation", &self.skip_validation)
.finish()
}
}
impl CreateExternalLocationRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.CreateExternalLocationRequest";
}
impl CreateExternalLocationRequest {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_read_only(mut self, value: bool) -> Self {
self.read_only = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_comment(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.comment = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_skip_validation(mut self, value: bool) -> Self {
self.skip_validation = Some(value);
self
}
}
impl ::buffa::DefaultInstance for CreateExternalLocationRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<CreateExternalLocationRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for CreateExternalLocationRequest {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "CreateExternalLocationRequest";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.CreateExternalLocationRequest";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.CreateExternalLocationRequest";
}
impl ::buffa::Message for CreateExternalLocationRequest {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if !self.url.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.url) as u32;
}
if !self.credential_name.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.credential_name) as u32;
}
if self.read_only.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if let Some(ref v) = self.comment {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.skip_validation.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if !self.url.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.url, buf);
}
if !self.credential_name.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.credential_name, buf);
}
if let Some(v) = self.read_only {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(ref v) = self.comment {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.skip_validation {
::buffa::encoding::Tag::new(6u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(&mut self.name, buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(&mut self.url, buf)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(&mut self.credential_name, buf)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.read_only = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.skip_validation = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name.clear();
self.url.clear();
self.credential_name.clear();
self.read_only = ::core::option::Option::None;
self.comment = ::core::option::Option::None;
self.skip_validation = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for CreateExternalLocationRequest {
const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.CreateExternalLocationRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for CreateExternalLocationRequest {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __CREATE_EXTERNAL_LOCATION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/unitycatalog.external_locations.v1.CreateExternalLocationRequest",
to_json: ::buffa::type_registry::any_to_json::<CreateExternalLocationRequest>,
from_json: ::buffa::type_registry::any_from_json::<CreateExternalLocationRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct GetExternalLocationRequest {
#[serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub name: ::buffa::alloc::string::String,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for GetExternalLocationRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("GetExternalLocationRequest").field("name", &self.name).finish()
}
}
impl GetExternalLocationRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.GetExternalLocationRequest";
}
impl ::buffa::DefaultInstance for GetExternalLocationRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<GetExternalLocationRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for GetExternalLocationRequest {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "GetExternalLocationRequest";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.GetExternalLocationRequest";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.GetExternalLocationRequest";
}
impl ::buffa::Message for GetExternalLocationRequest {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(&mut self.name, buf)?;
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name.clear();
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for GetExternalLocationRequest {
const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.GetExternalLocationRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for GetExternalLocationRequest {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __GET_EXTERNAL_LOCATION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/unitycatalog.external_locations.v1.GetExternalLocationRequest",
to_json: ::buffa::type_registry::any_to_json::<GetExternalLocationRequest>,
from_json: ::buffa::type_registry::any_from_json::<GetExternalLocationRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct UpdateExternalLocationRequest {
#[serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub name: ::buffa::alloc::string::String,
#[serde(rename = "url", skip_serializing_if = "::core::option::Option::is_none")]
pub url: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(
rename = "credential_name",
alias = "credentialName",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub credential_name: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(
rename = "read_only",
alias = "readOnly",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub read_only: ::core::option::Option<bool>,
#[serde(rename = "owner", skip_serializing_if = "::core::option::Option::is_none")]
pub owner: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(rename = "comment", skip_serializing_if = "::core::option::Option::is_none")]
pub comment: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(
rename = "new_name",
alias = "newName",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub new_name: ::core::option::Option<::buffa::alloc::string::String>,
#[serde(rename = "force", skip_serializing_if = "::core::option::Option::is_none")]
pub force: ::core::option::Option<bool>,
#[serde(
rename = "skip_validation",
alias = "skipValidation",
skip_serializing_if = "::core::option::Option::is_none"
)]
pub skip_validation: ::core::option::Option<bool>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for UpdateExternalLocationRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("UpdateExternalLocationRequest")
.field("name", &self.name)
.field("url", &self.url)
.field("credential_name", &self.credential_name)
.field("read_only", &self.read_only)
.field("owner", &self.owner)
.field("comment", &self.comment)
.field("new_name", &self.new_name)
.field("force", &self.force)
.field("skip_validation", &self.skip_validation)
.finish()
}
}
impl UpdateExternalLocationRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.UpdateExternalLocationRequest";
}
impl UpdateExternalLocationRequest {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_url(mut self, value: impl Into<::buffa::alloc::string::String>) -> Self {
self.url = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_credential_name(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.credential_name = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_read_only(mut self, value: bool) -> Self {
self.read_only = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_owner(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.owner = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_comment(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.comment = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_new_name(
mut self,
value: impl Into<::buffa::alloc::string::String>,
) -> Self {
self.new_name = Some(value.into());
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_force(mut self, value: bool) -> Self {
self.force = Some(value);
self
}
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_skip_validation(mut self, value: bool) -> Self {
self.skip_validation = Some(value);
self
}
}
impl ::buffa::DefaultInstance for UpdateExternalLocationRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<UpdateExternalLocationRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for UpdateExternalLocationRequest {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "UpdateExternalLocationRequest";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.UpdateExternalLocationRequest";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.UpdateExternalLocationRequest";
}
impl ::buffa::Message for UpdateExternalLocationRequest {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if let Some(ref v) = self.url {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.credential_name {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.read_only.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if let Some(ref v) = self.owner {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.comment {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.new_name {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.force.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.skip_validation.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if let Some(ref v) = self.url {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.credential_name {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.read_only {
::buffa::encoding::Tag::new(4u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(ref v) = self.owner {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.comment {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.new_name {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.force {
::buffa::encoding::Tag::new(8u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.skip_validation {
::buffa::encoding::Tag::new(9u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(&mut self.name, buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self.url.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
3u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.credential_name
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.read_only = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
5u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self.owner.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self.comment.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
7u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(
self
.new_name
.get_or_insert_with(::buffa::alloc::string::String::new),
buf,
)?;
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.force = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.skip_validation = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name.clear();
self.url = ::core::option::Option::None;
self.credential_name = ::core::option::Option::None;
self.read_only = ::core::option::Option::None;
self.owner = ::core::option::Option::None;
self.comment = ::core::option::Option::None;
self.new_name = ::core::option::Option::None;
self.force = ::core::option::Option::None;
self.skip_validation = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for UpdateExternalLocationRequest {
const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.UpdateExternalLocationRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for UpdateExternalLocationRequest {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __UPDATE_EXTERNAL_LOCATION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/unitycatalog.external_locations.v1.UpdateExternalLocationRequest",
to_json: ::buffa::type_registry::any_to_json::<UpdateExternalLocationRequest>,
from_json: ::buffa::type_registry::any_from_json::<UpdateExternalLocationRequest>,
is_wkt: false,
};
#[derive(Clone, PartialEq, Default)]
#[derive(::serde::Serialize, ::serde::Deserialize)]
#[serde(default)]
pub struct DeleteExternalLocationRequest {
#[serde(
rename = "name",
with = "::buffa::json_helpers::proto_string",
skip_serializing_if = "::buffa::json_helpers::skip_if::is_empty_str"
)]
pub name: ::buffa::alloc::string::String,
#[serde(rename = "force", skip_serializing_if = "::core::option::Option::is_none")]
pub force: ::core::option::Option<bool>,
#[serde(skip)]
#[doc(hidden)]
pub __buffa_unknown_fields: ::buffa::UnknownFields,
}
impl ::core::fmt::Debug for DeleteExternalLocationRequest {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("DeleteExternalLocationRequest")
.field("name", &self.name)
.field("force", &self.force)
.finish()
}
}
impl DeleteExternalLocationRequest {
pub const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.DeleteExternalLocationRequest";
}
impl DeleteExternalLocationRequest {
#[must_use = "with_* setters return `self` by value; assign or chain the result"]
#[inline]
pub fn with_force(mut self, value: bool) -> Self {
self.force = Some(value);
self
}
}
impl ::buffa::DefaultInstance for DeleteExternalLocationRequest {
fn default_instance() -> &'static Self {
static VALUE: ::buffa::__private::OnceBox<DeleteExternalLocationRequest> = ::buffa::__private::OnceBox::new();
VALUE.get_or_init(|| ::buffa::alloc::boxed::Box::new(Self::default()))
}
}
impl ::buffa::MessageName for DeleteExternalLocationRequest {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "DeleteExternalLocationRequest";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.DeleteExternalLocationRequest";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.DeleteExternalLocationRequest";
}
impl ::buffa::Message for DeleteExternalLocationRequest {
#[allow(clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if self.force.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if let Some(v) = self.force {
::buffa::encoding::Tag::new(2u32, ::buffa::encoding::WireType::Varint)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
fn merge_field(
&mut self,
tag: ::buffa::encoding::Tag,
buf: &mut impl ::buffa::bytes::Buf,
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
#[allow(unused_imports)]
use ::buffa::bytes::Buf as _;
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
match tag.field_number() {
1u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::LengthDelimited {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
::buffa::types::merge_string(&mut self.name, buf)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
self.force = ::core::option::Option::Some(
::buffa::types::decode_bool(buf)?,
);
}
_ => {
self.__buffa_unknown_fields
.push(::buffa::encoding::decode_unknown_field(tag, buf, depth)?);
}
}
::core::result::Result::Ok(())
}
fn clear(&mut self) {
self.name.clear();
self.force = ::core::option::Option::None;
self.__buffa_unknown_fields.clear();
}
}
impl ::buffa::ExtensionSet for DeleteExternalLocationRequest {
const PROTO_FQN: &'static str = "unitycatalog.external_locations.v1.DeleteExternalLocationRequest";
fn unknown_fields(&self) -> &::buffa::UnknownFields {
&self.__buffa_unknown_fields
}
fn unknown_fields_mut(&mut self) -> &mut ::buffa::UnknownFields {
&mut self.__buffa_unknown_fields
}
}
impl ::buffa::json_helpers::ProtoElemJson for DeleteExternalLocationRequest {
fn serialize_proto_json<S: ::serde::Serializer>(
v: &Self,
s: S,
) -> ::core::result::Result<S::Ok, S::Error> {
::serde::Serialize::serialize(v, s)
}
fn deserialize_proto_json<'de, D: ::serde::Deserializer<'de>>(
d: D,
) -> ::core::result::Result<Self, D::Error> {
<Self as ::serde::Deserialize>::deserialize(d)
}
}
#[doc(hidden)]
pub const __DELETE_EXTERNAL_LOCATION_REQUEST_JSON_ANY: ::buffa::type_registry::JsonAnyEntry = ::buffa::type_registry::JsonAnyEntry {
type_url: "type.googleapis.com/unitycatalog.external_locations.v1.DeleteExternalLocationRequest",
to_json: ::buffa::type_registry::any_to_json::<DeleteExternalLocationRequest>,
from_json: ::buffa::type_registry::any_from_json::<DeleteExternalLocationRequest>,
is_wkt: false,
};
#[allow(
non_camel_case_types,
dead_code,
unused_imports,
unused_qualifications,
clippy::derivable_impls,
clippy::match_single_binding,
clippy::uninlined_format_args,
clippy::doc_lazy_continuation,
clippy::module_inception
)]
pub mod __buffa {
#[allow(unused_imports)]
use super::*;
pub mod view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, Default)]
pub struct ExternalLocationView<'a> {
pub name: &'a str,
pub url: &'a str,
pub credential_name: &'a str,
pub read_only: bool,
pub comment: ::core::option::Option<&'a str>,
pub owner: ::core::option::Option<&'a str>,
pub credential_id: &'a str,
pub created_at: ::core::option::Option<i64>,
pub created_by: ::core::option::Option<&'a str>,
pub updated_at: ::core::option::Option<i64>,
pub updated_by: ::core::option::Option<&'a str>,
pub browse_only: ::core::option::Option<bool>,
pub external_location_id: ::core::option::Option<&'a str>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ExternalLocationView<'a> {
#[doc(hidden)]
pub fn _decode_depth(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let mut view = Self::default();
view._merge_into_view(buf, depth)?;
::core::result::Result::Ok(view)
}
#[doc(hidden)]
pub fn _merge_into_view(
&mut self,
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
let _ = depth;
#[allow(unused_variables)]
let view = self;
let mut cur: &'a [u8] = buf;
while !cur.is_empty() {
let before_tag = cur;
let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
match tag.field_number() {
1u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.name = ::buffa::types::borrow_str(&mut cur)?;
}
2u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.url = ::buffa::types::borrow_str(&mut cur)?;
}
3u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.credential_name = ::buffa::types::borrow_str(&mut cur)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
view.read_only = ::buffa::types::decode_bool(&mut cur)?;
}
5u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
}
6u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.owner = Some(::buffa::types::borrow_str(&mut cur)?);
}
8u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.credential_id = ::buffa::types::borrow_str(&mut cur)?;
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
view.created_at = Some(
::buffa::types::decode_int64(&mut cur)?,
);
}
10u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 10u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.created_by = Some(
::buffa::types::borrow_str(&mut cur)?,
);
}
11u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 11u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
view.updated_at = Some(
::buffa::types::decode_int64(&mut cur)?,
);
}
12u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 12u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.updated_by = Some(
::buffa::types::borrow_str(&mut cur)?,
);
}
13u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 13u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
view.browse_only = Some(
::buffa::types::decode_bool(&mut cur)?,
);
}
100u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 100u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.external_location_id = Some(
::buffa::types::borrow_str(&mut cur)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_raw(&before_tag[..span_len]);
}
}
}
::core::result::Result::Ok(())
}
}
impl<'a> ::buffa::MessageView<'a> for ExternalLocationView<'a> {
type Owned = super::super::ExternalLocation;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
}
fn decode_view_with_limit(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, depth)
}
fn to_owned_message(&self) -> super::super::ExternalLocation {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> super::super::ExternalLocation {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
super::super::ExternalLocation {
name: self.name.to_string(),
url: self.url.to_string(),
credential_name: self.credential_name.to_string(),
read_only: self.read_only,
comment: self.comment.map(|s| s.to_string()),
owner: self.owner.map(|s| s.to_string()),
credential_id: self.credential_id.to_string(),
created_at: self.created_at,
created_by: self.created_by.map(|s| s.to_string()),
updated_at: self.updated_at,
updated_by: self.updated_by.map(|s| s.to_string()),
browse_only: self.browse_only,
external_location_id: self
.external_location_id
.map(|s| s.to_string()),
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()
.unwrap_or_default()
.into(),
..::core::default::Default::default()
}
}
}
impl<'a> ::buffa::ViewEncode<'a> for ExternalLocationView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if !self.url.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.url) as u32;
}
if !self.credential_name.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.credential_name)
as u32;
}
if self.read_only {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if let Some(ref v) = self.comment {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.owner {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if !self.credential_id.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.credential_id)
as u32;
}
if let Some(v) = self.created_at {
size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
}
if let Some(ref v) = self.created_by {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(v) = self.updated_at {
size += 1u32 + ::buffa::types::int64_encoded_len(v) as u32;
}
if let Some(ref v) = self.updated_by {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.browse_only.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if let Some(ref v) = self.external_location_id {
size += 2u32 + ::buffa::types::string_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if !self.url.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.url, buf);
}
if !self.credential_name.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.credential_name, buf);
}
if self.read_only {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_bool(self.read_only, buf);
}
if let Some(ref v) = self.comment {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.owner {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if !self.credential_id.is_empty() {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.credential_id, buf);
}
if let Some(v) = self.created_at {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_int64(v, buf);
}
if let Some(ref v) = self.created_by {
::buffa::encoding::Tag::new(
10u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.updated_at {
::buffa::encoding::Tag::new(
11u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_int64(v, buf);
}
if let Some(ref v) = self.updated_by {
::buffa::encoding::Tag::new(
12u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.browse_only {
::buffa::encoding::Tag::new(
13u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(ref v) = self.external_location_id {
::buffa::encoding::Tag::new(
100u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for ExternalLocationView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
__map.serialize_entry("name", self.name)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.url) {
__map.serialize_entry("url", self.url)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.credential_name) {
__map.serialize_entry("credential_name", self.credential_name)?;
}
if self.read_only {
__map.serialize_entry("read_only", &self.read_only)?;
}
if let ::core::option::Option::Some(__v) = self.comment {
__map.serialize_entry("comment", __v)?;
}
if let ::core::option::Option::Some(__v) = self.owner {
__map.serialize_entry("owner", __v)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.credential_id) {
__map.serialize_entry("credential_id", self.credential_id)?;
}
if let ::core::option::Option::Some(__v) = self.created_at {
struct _W(i64);
impl ::serde::Serialize for _W {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::buffa::json_helpers::int64::serialize(&self.0, __s)
}
}
__map.serialize_entry("created_at", &_W(__v))?;
}
if let ::core::option::Option::Some(__v) = self.created_by {
__map.serialize_entry("created_by", __v)?;
}
if let ::core::option::Option::Some(__v) = self.updated_at {
struct _W(i64);
impl ::serde::Serialize for _W {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::buffa::json_helpers::int64::serialize(&self.0, __s)
}
}
__map.serialize_entry("updated_at", &_W(__v))?;
}
if let ::core::option::Option::Some(__v) = self.updated_by {
__map.serialize_entry("updated_by", __v)?;
}
if let ::core::option::Option::Some(__v) = self.browse_only {
__map.serialize_entry("browse_only", &__v)?;
}
if let ::core::option::Option::Some(__v) = self.external_location_id {
__map.serialize_entry("external_location_id", __v)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for ExternalLocationView<'a> {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "ExternalLocation";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.ExternalLocation";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ExternalLocation";
}
impl<'v> ::buffa::DefaultViewInstance for ExternalLocationView<'v> {
fn default_view_instance<'a>() -> &'a Self
where
Self: 'a,
{
static VALUE: ::buffa::__private::OnceBox<
ExternalLocationView<'static>,
> = ::buffa::__private::OnceBox::new();
VALUE
.get_or_init(|| ::buffa::alloc::boxed::Box::new(
<ExternalLocationView<'static>>::default(),
))
}
}
impl ::buffa::ViewReborrow for ExternalLocationView<'static> {
type Reborrowed<'b> = ExternalLocationView<'b>;
fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
this
}
}
#[derive(Clone, Debug)]
pub struct ExternalLocationOwnedView(
::buffa::OwnedView<ExternalLocationView<'static>>,
);
impl ExternalLocationOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ExternalLocationOwnedView(::buffa::OwnedView::decode(bytes)?),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ExternalLocationOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::ExternalLocation,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ExternalLocationOwnedView(::buffa::OwnedView::from_owned(msg)?),
)
}
#[must_use]
pub fn view(&self) -> &ExternalLocationView<'_> {
self.0.reborrow()
}
#[must_use]
pub fn to_owned_message(&self) -> super::super::ExternalLocation {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn name(&self) -> &'_ str {
self.0.reborrow().name
}
#[must_use]
pub fn url(&self) -> &'_ str {
self.0.reborrow().url
}
#[must_use]
pub fn credential_name(&self) -> &'_ str {
self.0.reborrow().credential_name
}
#[must_use]
pub fn read_only(&self) -> bool {
self.0.reborrow().read_only
}
#[must_use]
pub fn comment(&self) -> ::core::option::Option<&'_ str> {
self.0.reborrow().comment
}
#[must_use]
pub fn owner(&self) -> ::core::option::Option<&'_ str> {
self.0.reborrow().owner
}
#[must_use]
pub fn credential_id(&self) -> &'_ str {
self.0.reborrow().credential_id
}
#[must_use]
pub fn created_at(&self) -> ::core::option::Option<i64> {
self.0.reborrow().created_at
}
#[must_use]
pub fn created_by(&self) -> ::core::option::Option<&'_ str> {
self.0.reborrow().created_by
}
#[must_use]
pub fn updated_at(&self) -> ::core::option::Option<i64> {
self.0.reborrow().updated_at
}
#[must_use]
pub fn updated_by(&self) -> ::core::option::Option<&'_ str> {
self.0.reborrow().updated_by
}
#[must_use]
pub fn browse_only(&self) -> ::core::option::Option<bool> {
self.0.reborrow().browse_only
}
#[must_use]
pub fn external_location_id(&self) -> ::core::option::Option<&'_ str> {
self.0.reborrow().external_location_id
}
}
impl ::core::convert::From<::buffa::OwnedView<ExternalLocationView<'static>>>
for ExternalLocationOwnedView {
fn from(inner: ::buffa::OwnedView<ExternalLocationView<'static>>) -> Self {
ExternalLocationOwnedView(inner)
}
}
impl ::core::convert::From<ExternalLocationOwnedView>
for ::buffa::OwnedView<ExternalLocationView<'static>> {
fn from(wrapper: ExternalLocationOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<::buffa::OwnedView<ExternalLocationView<'static>>>
for ExternalLocationOwnedView {
fn as_ref(&self) -> &::buffa::OwnedView<ExternalLocationView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::ExternalLocation {
type View<'a> = ExternalLocationView<'a>;
type ViewHandle = ExternalLocationOwnedView;
}
impl ::serde::Serialize for ExternalLocationOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct ListExternalLocationsRequestView<'a> {
pub max_results: ::core::option::Option<i32>,
pub page_token: ::core::option::Option<&'a str>,
pub include_browse: ::core::option::Option<bool>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ListExternalLocationsRequestView<'a> {
#[doc(hidden)]
pub fn _decode_depth(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let mut view = Self::default();
view._merge_into_view(buf, depth)?;
::core::result::Result::Ok(view)
}
#[doc(hidden)]
pub fn _merge_into_view(
&mut self,
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
let _ = depth;
#[allow(unused_variables)]
let view = self;
let mut cur: &'a [u8] = buf;
while !cur.is_empty() {
let before_tag = cur;
let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
match tag.field_number() {
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
view.max_results = Some(
::buffa::types::decode_int32(&mut cur)?,
);
}
3u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.page_token = Some(
::buffa::types::borrow_str(&mut cur)?,
);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
view.include_browse = Some(
::buffa::types::decode_bool(&mut cur)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_raw(&before_tag[..span_len]);
}
}
}
::core::result::Result::Ok(())
}
}
impl<'a> ::buffa::MessageView<'a> for ListExternalLocationsRequestView<'a> {
type Owned = super::super::ListExternalLocationsRequest;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
}
fn decode_view_with_limit(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, depth)
}
fn to_owned_message(&self) -> super::super::ListExternalLocationsRequest {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> super::super::ListExternalLocationsRequest {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
super::super::ListExternalLocationsRequest {
max_results: self.max_results,
page_token: self.page_token.map(|s| s.to_string()),
include_browse: self.include_browse,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()
.unwrap_or_default()
.into(),
..::core::default::Default::default()
}
}
}
impl<'a> ::buffa::ViewEncode<'a> for ListExternalLocationsRequestView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if let Some(v) = self.max_results {
size += 1u32 + ::buffa::types::int32_encoded_len(v) as u32;
}
if let Some(ref v) = self.page_token {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.include_browse.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if let Some(v) = self.max_results {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_int32(v, buf);
}
if let Some(ref v) = self.page_token {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.include_browse {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for ListExternalLocationsRequestView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if let ::core::option::Option::Some(__v) = self.max_results {
struct _W(i32);
impl ::serde::Serialize for _W {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::buffa::json_helpers::int32::serialize(&self.0, __s)
}
}
__map.serialize_entry("max_results", &_W(__v))?;
}
if let ::core::option::Option::Some(__v) = self.page_token {
__map.serialize_entry("page_token", __v)?;
}
if let ::core::option::Option::Some(__v) = self.include_browse {
__map.serialize_entry("include_browse", &__v)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for ListExternalLocationsRequestView<'a> {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "ListExternalLocationsRequest";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.ListExternalLocationsRequest";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsRequest";
}
impl<'v> ::buffa::DefaultViewInstance for ListExternalLocationsRequestView<'v> {
fn default_view_instance<'a>() -> &'a Self
where
Self: 'a,
{
static VALUE: ::buffa::__private::OnceBox<
ListExternalLocationsRequestView<'static>,
> = ::buffa::__private::OnceBox::new();
VALUE
.get_or_init(|| ::buffa::alloc::boxed::Box::new(
<ListExternalLocationsRequestView<'static>>::default(),
))
}
}
impl ::buffa::ViewReborrow for ListExternalLocationsRequestView<'static> {
type Reborrowed<'b> = ListExternalLocationsRequestView<'b>;
fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
this
}
}
#[derive(Clone, Debug)]
pub struct ListExternalLocationsRequestOwnedView(
::buffa::OwnedView<ListExternalLocationsRequestView<'static>>,
);
impl ListExternalLocationsRequestOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ListExternalLocationsRequestOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ListExternalLocationsRequestOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::ListExternalLocationsRequest,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ListExternalLocationsRequestOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &ListExternalLocationsRequestView<'_> {
self.0.reborrow()
}
#[must_use]
pub fn to_owned_message(
&self,
) -> super::super::ListExternalLocationsRequest {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn max_results(&self) -> ::core::option::Option<i32> {
self.0.reborrow().max_results
}
#[must_use]
pub fn page_token(&self) -> ::core::option::Option<&'_ str> {
self.0.reborrow().page_token
}
#[must_use]
pub fn include_browse(&self) -> ::core::option::Option<bool> {
self.0.reborrow().include_browse
}
}
impl ::core::convert::From<
::buffa::OwnedView<ListExternalLocationsRequestView<'static>>,
> for ListExternalLocationsRequestOwnedView {
fn from(
inner: ::buffa::OwnedView<ListExternalLocationsRequestView<'static>>,
) -> Self {
ListExternalLocationsRequestOwnedView(inner)
}
}
impl ::core::convert::From<ListExternalLocationsRequestOwnedView>
for ::buffa::OwnedView<ListExternalLocationsRequestView<'static>> {
fn from(wrapper: ListExternalLocationsRequestOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<ListExternalLocationsRequestView<'static>>,
> for ListExternalLocationsRequestOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<ListExternalLocationsRequestView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::ListExternalLocationsRequest {
type View<'a> = ListExternalLocationsRequestView<'a>;
type ViewHandle = ListExternalLocationsRequestOwnedView;
}
impl ::serde::Serialize for ListExternalLocationsRequestOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct ListExternalLocationsResponseView<'a> {
pub external_locations: ::buffa::RepeatedView<
'a,
super::super::__buffa::view::ExternalLocationView<'a>,
>,
pub next_page_token: ::core::option::Option<&'a str>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> ListExternalLocationsResponseView<'a> {
#[doc(hidden)]
pub fn _decode_depth(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let mut view = Self::default();
view._merge_into_view(buf, depth)?;
::core::result::Result::Ok(view)
}
#[doc(hidden)]
pub fn _merge_into_view(
&mut self,
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
let _ = depth;
#[allow(unused_variables)]
let view = self;
let mut cur: &'a [u8] = buf;
while !cur.is_empty() {
let before_tag = cur;
let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
match tag.field_number() {
2u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.next_page_token = Some(
::buffa::types::borrow_str(&mut cur)?,
);
}
1u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
if depth == 0 {
return Err(::buffa::DecodeError::RecursionLimitExceeded);
}
let sub = ::buffa::types::borrow_bytes(&mut cur)?;
view.external_locations
.push(
super::super::__buffa::view::ExternalLocationView::_decode_depth(
sub,
depth - 1,
)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_raw(&before_tag[..span_len]);
}
}
}
::core::result::Result::Ok(())
}
}
impl<'a> ::buffa::MessageView<'a> for ListExternalLocationsResponseView<'a> {
type Owned = super::super::ListExternalLocationsResponse;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
}
fn decode_view_with_limit(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, depth)
}
fn to_owned_message(&self) -> super::super::ListExternalLocationsResponse {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> super::super::ListExternalLocationsResponse {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
super::super::ListExternalLocationsResponse {
external_locations: self
.external_locations
.iter()
.map(|v| v.to_owned_from_source(__buffa_src))
.collect(),
next_page_token: self.next_page_token.map(|s| s.to_string()),
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()
.unwrap_or_default()
.into(),
..::core::default::Default::default()
}
}
}
impl<'a> ::buffa::ViewEncode<'a> for ListExternalLocationsResponseView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, __cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
for v in &self.external_locations {
let __slot = __cache.reserve();
let inner_size = v.compute_size(__cache);
__cache.set(__slot, inner_size);
size
+= 1u32 + ::buffa::encoding::varint_len(inner_size as u64) as u32
+ inner_size;
}
if let Some(ref v) = self.next_page_token {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
__cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
for v in &self.external_locations {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::encoding::encode_varint(__cache.consume_next() as u64, buf);
v.write_to(__cache, buf);
}
if let Some(ref v) = self.next_page_token {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for ListExternalLocationsResponseView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !self.external_locations.is_empty() {
__map
.serialize_entry(
"externalLocations",
&*self.external_locations,
)?;
}
if let ::core::option::Option::Some(__v) = self.next_page_token {
__map.serialize_entry("next_page_token", __v)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for ListExternalLocationsResponseView<'a> {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "ListExternalLocationsResponse";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.ListExternalLocationsResponse";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.ListExternalLocationsResponse";
}
impl<'v> ::buffa::DefaultViewInstance for ListExternalLocationsResponseView<'v> {
fn default_view_instance<'a>() -> &'a Self
where
Self: 'a,
{
static VALUE: ::buffa::__private::OnceBox<
ListExternalLocationsResponseView<'static>,
> = ::buffa::__private::OnceBox::new();
VALUE
.get_or_init(|| ::buffa::alloc::boxed::Box::new(
<ListExternalLocationsResponseView<'static>>::default(),
))
}
}
impl ::buffa::ViewReborrow for ListExternalLocationsResponseView<'static> {
type Reborrowed<'b> = ListExternalLocationsResponseView<'b>;
fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
this
}
}
#[derive(Clone, Debug)]
pub struct ListExternalLocationsResponseOwnedView(
::buffa::OwnedView<ListExternalLocationsResponseView<'static>>,
);
impl ListExternalLocationsResponseOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ListExternalLocationsResponseOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ListExternalLocationsResponseOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::ListExternalLocationsResponse,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
ListExternalLocationsResponseOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &ListExternalLocationsResponseView<'_> {
self.0.reborrow()
}
#[must_use]
pub fn to_owned_message(
&self,
) -> super::super::ListExternalLocationsResponse {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn external_locations(
&self,
) -> &::buffa::RepeatedView<
'_,
super::super::__buffa::view::ExternalLocationView<'_>,
> {
&self.0.reborrow().external_locations
}
#[must_use]
pub fn next_page_token(&self) -> ::core::option::Option<&'_ str> {
self.0.reborrow().next_page_token
}
}
impl ::core::convert::From<
::buffa::OwnedView<ListExternalLocationsResponseView<'static>>,
> for ListExternalLocationsResponseOwnedView {
fn from(
inner: ::buffa::OwnedView<ListExternalLocationsResponseView<'static>>,
) -> Self {
ListExternalLocationsResponseOwnedView(inner)
}
}
impl ::core::convert::From<ListExternalLocationsResponseOwnedView>
for ::buffa::OwnedView<ListExternalLocationsResponseView<'static>> {
fn from(wrapper: ListExternalLocationsResponseOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<ListExternalLocationsResponseView<'static>>,
> for ListExternalLocationsResponseOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<ListExternalLocationsResponseView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::ListExternalLocationsResponse {
type View<'a> = ListExternalLocationsResponseView<'a>;
type ViewHandle = ListExternalLocationsResponseOwnedView;
}
impl ::serde::Serialize for ListExternalLocationsResponseOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct CreateExternalLocationRequestView<'a> {
pub name: &'a str,
pub url: &'a str,
pub credential_name: &'a str,
pub read_only: ::core::option::Option<bool>,
pub comment: ::core::option::Option<&'a str>,
pub skip_validation: ::core::option::Option<bool>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> CreateExternalLocationRequestView<'a> {
#[doc(hidden)]
pub fn _decode_depth(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let mut view = Self::default();
view._merge_into_view(buf, depth)?;
::core::result::Result::Ok(view)
}
#[doc(hidden)]
pub fn _merge_into_view(
&mut self,
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
let _ = depth;
#[allow(unused_variables)]
let view = self;
let mut cur: &'a [u8] = buf;
while !cur.is_empty() {
let before_tag = cur;
let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
match tag.field_number() {
1u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.name = ::buffa::types::borrow_str(&mut cur)?;
}
2u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.url = ::buffa::types::borrow_str(&mut cur)?;
}
3u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.credential_name = ::buffa::types::borrow_str(&mut cur)?;
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
view.read_only = Some(
::buffa::types::decode_bool(&mut cur)?,
);
}
5u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
}
6u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
view.skip_validation = Some(
::buffa::types::decode_bool(&mut cur)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_raw(&before_tag[..span_len]);
}
}
}
::core::result::Result::Ok(())
}
}
impl<'a> ::buffa::MessageView<'a> for CreateExternalLocationRequestView<'a> {
type Owned = super::super::CreateExternalLocationRequest;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
}
fn decode_view_with_limit(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, depth)
}
fn to_owned_message(&self) -> super::super::CreateExternalLocationRequest {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> super::super::CreateExternalLocationRequest {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
super::super::CreateExternalLocationRequest {
name: self.name.to_string(),
url: self.url.to_string(),
credential_name: self.credential_name.to_string(),
read_only: self.read_only,
comment: self.comment.map(|s| s.to_string()),
skip_validation: self.skip_validation,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()
.unwrap_or_default()
.into(),
..::core::default::Default::default()
}
}
}
impl<'a> ::buffa::ViewEncode<'a> for CreateExternalLocationRequestView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if !self.url.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.url) as u32;
}
if !self.credential_name.is_empty() {
size
+= 1u32
+ ::buffa::types::string_encoded_len(&self.credential_name)
as u32;
}
if self.read_only.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if let Some(ref v) = self.comment {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.skip_validation.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if !self.url.is_empty() {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.url, buf);
}
if !self.credential_name.is_empty() {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.credential_name, buf);
}
if let Some(v) = self.read_only {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(ref v) = self.comment {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.skip_validation {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for CreateExternalLocationRequestView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
__map.serialize_entry("name", self.name)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.url) {
__map.serialize_entry("url", self.url)?;
}
if !::buffa::json_helpers::skip_if::is_empty_str(self.credential_name) {
__map.serialize_entry("credential_name", self.credential_name)?;
}
if let ::core::option::Option::Some(__v) = self.read_only {
__map.serialize_entry("read_only", &__v)?;
}
if let ::core::option::Option::Some(__v) = self.comment {
__map.serialize_entry("comment", __v)?;
}
if let ::core::option::Option::Some(__v) = self.skip_validation {
__map.serialize_entry("skip_validation", &__v)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for CreateExternalLocationRequestView<'a> {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "CreateExternalLocationRequest";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.CreateExternalLocationRequest";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.CreateExternalLocationRequest";
}
impl<'v> ::buffa::DefaultViewInstance for CreateExternalLocationRequestView<'v> {
fn default_view_instance<'a>() -> &'a Self
where
Self: 'a,
{
static VALUE: ::buffa::__private::OnceBox<
CreateExternalLocationRequestView<'static>,
> = ::buffa::__private::OnceBox::new();
VALUE
.get_or_init(|| ::buffa::alloc::boxed::Box::new(
<CreateExternalLocationRequestView<'static>>::default(),
))
}
}
impl ::buffa::ViewReborrow for CreateExternalLocationRequestView<'static> {
type Reborrowed<'b> = CreateExternalLocationRequestView<'b>;
fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
this
}
}
#[derive(Clone, Debug)]
pub struct CreateExternalLocationRequestOwnedView(
::buffa::OwnedView<CreateExternalLocationRequestView<'static>>,
);
impl CreateExternalLocationRequestOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
CreateExternalLocationRequestOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
CreateExternalLocationRequestOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::CreateExternalLocationRequest,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
CreateExternalLocationRequestOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &CreateExternalLocationRequestView<'_> {
self.0.reborrow()
}
#[must_use]
pub fn to_owned_message(
&self,
) -> super::super::CreateExternalLocationRequest {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn name(&self) -> &'_ str {
self.0.reborrow().name
}
#[must_use]
pub fn url(&self) -> &'_ str {
self.0.reborrow().url
}
#[must_use]
pub fn credential_name(&self) -> &'_ str {
self.0.reborrow().credential_name
}
#[must_use]
pub fn read_only(&self) -> ::core::option::Option<bool> {
self.0.reborrow().read_only
}
#[must_use]
pub fn comment(&self) -> ::core::option::Option<&'_ str> {
self.0.reborrow().comment
}
#[must_use]
pub fn skip_validation(&self) -> ::core::option::Option<bool> {
self.0.reborrow().skip_validation
}
}
impl ::core::convert::From<
::buffa::OwnedView<CreateExternalLocationRequestView<'static>>,
> for CreateExternalLocationRequestOwnedView {
fn from(
inner: ::buffa::OwnedView<CreateExternalLocationRequestView<'static>>,
) -> Self {
CreateExternalLocationRequestOwnedView(inner)
}
}
impl ::core::convert::From<CreateExternalLocationRequestOwnedView>
for ::buffa::OwnedView<CreateExternalLocationRequestView<'static>> {
fn from(wrapper: CreateExternalLocationRequestOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<CreateExternalLocationRequestView<'static>>,
> for CreateExternalLocationRequestOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<CreateExternalLocationRequestView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::CreateExternalLocationRequest {
type View<'a> = CreateExternalLocationRequestView<'a>;
type ViewHandle = CreateExternalLocationRequestOwnedView;
}
impl ::serde::Serialize for CreateExternalLocationRequestOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct GetExternalLocationRequestView<'a> {
pub name: &'a str,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> GetExternalLocationRequestView<'a> {
#[doc(hidden)]
pub fn _decode_depth(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let mut view = Self::default();
view._merge_into_view(buf, depth)?;
::core::result::Result::Ok(view)
}
#[doc(hidden)]
pub fn _merge_into_view(
&mut self,
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
let _ = depth;
#[allow(unused_variables)]
let view = self;
let mut cur: &'a [u8] = buf;
while !cur.is_empty() {
let before_tag = cur;
let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
match tag.field_number() {
1u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.name = ::buffa::types::borrow_str(&mut cur)?;
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_raw(&before_tag[..span_len]);
}
}
}
::core::result::Result::Ok(())
}
}
impl<'a> ::buffa::MessageView<'a> for GetExternalLocationRequestView<'a> {
type Owned = super::super::GetExternalLocationRequest;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
}
fn decode_view_with_limit(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, depth)
}
fn to_owned_message(&self) -> super::super::GetExternalLocationRequest {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> super::super::GetExternalLocationRequest {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
super::super::GetExternalLocationRequest {
name: self.name.to_string(),
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()
.unwrap_or_default()
.into(),
..::core::default::Default::default()
}
}
}
impl<'a> ::buffa::ViewEncode<'a> for GetExternalLocationRequestView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for GetExternalLocationRequestView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
__map.serialize_entry("name", self.name)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for GetExternalLocationRequestView<'a> {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "GetExternalLocationRequest";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.GetExternalLocationRequest";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.GetExternalLocationRequest";
}
impl<'v> ::buffa::DefaultViewInstance for GetExternalLocationRequestView<'v> {
fn default_view_instance<'a>() -> &'a Self
where
Self: 'a,
{
static VALUE: ::buffa::__private::OnceBox<
GetExternalLocationRequestView<'static>,
> = ::buffa::__private::OnceBox::new();
VALUE
.get_or_init(|| ::buffa::alloc::boxed::Box::new(
<GetExternalLocationRequestView<'static>>::default(),
))
}
}
impl ::buffa::ViewReborrow for GetExternalLocationRequestView<'static> {
type Reborrowed<'b> = GetExternalLocationRequestView<'b>;
fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
this
}
}
#[derive(Clone, Debug)]
pub struct GetExternalLocationRequestOwnedView(
::buffa::OwnedView<GetExternalLocationRequestView<'static>>,
);
impl GetExternalLocationRequestOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetExternalLocationRequestOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetExternalLocationRequestOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::GetExternalLocationRequest,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
GetExternalLocationRequestOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &GetExternalLocationRequestView<'_> {
self.0.reborrow()
}
#[must_use]
pub fn to_owned_message(&self) -> super::super::GetExternalLocationRequest {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn name(&self) -> &'_ str {
self.0.reborrow().name
}
}
impl ::core::convert::From<
::buffa::OwnedView<GetExternalLocationRequestView<'static>>,
> for GetExternalLocationRequestOwnedView {
fn from(
inner: ::buffa::OwnedView<GetExternalLocationRequestView<'static>>,
) -> Self {
GetExternalLocationRequestOwnedView(inner)
}
}
impl ::core::convert::From<GetExternalLocationRequestOwnedView>
for ::buffa::OwnedView<GetExternalLocationRequestView<'static>> {
fn from(wrapper: GetExternalLocationRequestOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<GetExternalLocationRequestView<'static>>,
> for GetExternalLocationRequestOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<GetExternalLocationRequestView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::GetExternalLocationRequest {
type View<'a> = GetExternalLocationRequestView<'a>;
type ViewHandle = GetExternalLocationRequestOwnedView;
}
impl ::serde::Serialize for GetExternalLocationRequestOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct UpdateExternalLocationRequestView<'a> {
pub name: &'a str,
pub url: ::core::option::Option<&'a str>,
pub credential_name: ::core::option::Option<&'a str>,
pub read_only: ::core::option::Option<bool>,
pub owner: ::core::option::Option<&'a str>,
pub comment: ::core::option::Option<&'a str>,
pub new_name: ::core::option::Option<&'a str>,
pub force: ::core::option::Option<bool>,
pub skip_validation: ::core::option::Option<bool>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> UpdateExternalLocationRequestView<'a> {
#[doc(hidden)]
pub fn _decode_depth(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let mut view = Self::default();
view._merge_into_view(buf, depth)?;
::core::result::Result::Ok(view)
}
#[doc(hidden)]
pub fn _merge_into_view(
&mut self,
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
let _ = depth;
#[allow(unused_variables)]
let view = self;
let mut cur: &'a [u8] = buf;
while !cur.is_empty() {
let before_tag = cur;
let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
match tag.field_number() {
1u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.name = ::buffa::types::borrow_str(&mut cur)?;
}
2u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.url = Some(::buffa::types::borrow_str(&mut cur)?);
}
3u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 3u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.credential_name = Some(
::buffa::types::borrow_str(&mut cur)?,
);
}
4u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 4u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
view.read_only = Some(
::buffa::types::decode_bool(&mut cur)?,
);
}
5u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 5u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.owner = Some(::buffa::types::borrow_str(&mut cur)?);
}
6u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 6u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.comment = Some(::buffa::types::borrow_str(&mut cur)?);
}
7u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 7u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.new_name = Some(::buffa::types::borrow_str(&mut cur)?);
}
8u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 8u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
view.force = Some(::buffa::types::decode_bool(&mut cur)?);
}
9u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 9u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
view.skip_validation = Some(
::buffa::types::decode_bool(&mut cur)?,
);
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_raw(&before_tag[..span_len]);
}
}
}
::core::result::Result::Ok(())
}
}
impl<'a> ::buffa::MessageView<'a> for UpdateExternalLocationRequestView<'a> {
type Owned = super::super::UpdateExternalLocationRequest;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
}
fn decode_view_with_limit(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, depth)
}
fn to_owned_message(&self) -> super::super::UpdateExternalLocationRequest {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> super::super::UpdateExternalLocationRequest {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
super::super::UpdateExternalLocationRequest {
name: self.name.to_string(),
url: self.url.map(|s| s.to_string()),
credential_name: self.credential_name.map(|s| s.to_string()),
read_only: self.read_only,
owner: self.owner.map(|s| s.to_string()),
comment: self.comment.map(|s| s.to_string()),
new_name: self.new_name.map(|s| s.to_string()),
force: self.force,
skip_validation: self.skip_validation,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()
.unwrap_or_default()
.into(),
..::core::default::Default::default()
}
}
}
impl<'a> ::buffa::ViewEncode<'a> for UpdateExternalLocationRequestView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if let Some(ref v) = self.url {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.credential_name {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.read_only.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if let Some(ref v) = self.owner {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.comment {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if let Some(ref v) = self.new_name {
size += 1u32 + ::buffa::types::string_encoded_len(v) as u32;
}
if self.force.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
if self.skip_validation.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if let Some(ref v) = self.url {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.credential_name {
::buffa::encoding::Tag::new(
3u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.read_only {
::buffa::encoding::Tag::new(
4u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(ref v) = self.owner {
::buffa::encoding::Tag::new(
5u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.comment {
::buffa::encoding::Tag::new(
6u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(ref v) = self.new_name {
::buffa::encoding::Tag::new(
7u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(v, buf);
}
if let Some(v) = self.force {
::buffa::encoding::Tag::new(
8u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
if let Some(v) = self.skip_validation {
::buffa::encoding::Tag::new(
9u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for UpdateExternalLocationRequestView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
__map.serialize_entry("name", self.name)?;
}
if let ::core::option::Option::Some(__v) = self.url {
__map.serialize_entry("url", __v)?;
}
if let ::core::option::Option::Some(__v) = self.credential_name {
__map.serialize_entry("credential_name", __v)?;
}
if let ::core::option::Option::Some(__v) = self.read_only {
__map.serialize_entry("read_only", &__v)?;
}
if let ::core::option::Option::Some(__v) = self.owner {
__map.serialize_entry("owner", __v)?;
}
if let ::core::option::Option::Some(__v) = self.comment {
__map.serialize_entry("comment", __v)?;
}
if let ::core::option::Option::Some(__v) = self.new_name {
__map.serialize_entry("new_name", __v)?;
}
if let ::core::option::Option::Some(__v) = self.force {
__map.serialize_entry("force", &__v)?;
}
if let ::core::option::Option::Some(__v) = self.skip_validation {
__map.serialize_entry("skip_validation", &__v)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for UpdateExternalLocationRequestView<'a> {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "UpdateExternalLocationRequest";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.UpdateExternalLocationRequest";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.UpdateExternalLocationRequest";
}
impl<'v> ::buffa::DefaultViewInstance for UpdateExternalLocationRequestView<'v> {
fn default_view_instance<'a>() -> &'a Self
where
Self: 'a,
{
static VALUE: ::buffa::__private::OnceBox<
UpdateExternalLocationRequestView<'static>,
> = ::buffa::__private::OnceBox::new();
VALUE
.get_or_init(|| ::buffa::alloc::boxed::Box::new(
<UpdateExternalLocationRequestView<'static>>::default(),
))
}
}
impl ::buffa::ViewReborrow for UpdateExternalLocationRequestView<'static> {
type Reborrowed<'b> = UpdateExternalLocationRequestView<'b>;
fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
this
}
}
#[derive(Clone, Debug)]
pub struct UpdateExternalLocationRequestOwnedView(
::buffa::OwnedView<UpdateExternalLocationRequestView<'static>>,
);
impl UpdateExternalLocationRequestOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
UpdateExternalLocationRequestOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
UpdateExternalLocationRequestOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::UpdateExternalLocationRequest,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
UpdateExternalLocationRequestOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &UpdateExternalLocationRequestView<'_> {
self.0.reborrow()
}
#[must_use]
pub fn to_owned_message(
&self,
) -> super::super::UpdateExternalLocationRequest {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn name(&self) -> &'_ str {
self.0.reborrow().name
}
#[must_use]
pub fn url(&self) -> ::core::option::Option<&'_ str> {
self.0.reborrow().url
}
#[must_use]
pub fn credential_name(&self) -> ::core::option::Option<&'_ str> {
self.0.reborrow().credential_name
}
#[must_use]
pub fn read_only(&self) -> ::core::option::Option<bool> {
self.0.reborrow().read_only
}
#[must_use]
pub fn owner(&self) -> ::core::option::Option<&'_ str> {
self.0.reborrow().owner
}
#[must_use]
pub fn comment(&self) -> ::core::option::Option<&'_ str> {
self.0.reborrow().comment
}
#[must_use]
pub fn new_name(&self) -> ::core::option::Option<&'_ str> {
self.0.reborrow().new_name
}
#[must_use]
pub fn force(&self) -> ::core::option::Option<bool> {
self.0.reborrow().force
}
#[must_use]
pub fn skip_validation(&self) -> ::core::option::Option<bool> {
self.0.reborrow().skip_validation
}
}
impl ::core::convert::From<
::buffa::OwnedView<UpdateExternalLocationRequestView<'static>>,
> for UpdateExternalLocationRequestOwnedView {
fn from(
inner: ::buffa::OwnedView<UpdateExternalLocationRequestView<'static>>,
) -> Self {
UpdateExternalLocationRequestOwnedView(inner)
}
}
impl ::core::convert::From<UpdateExternalLocationRequestOwnedView>
for ::buffa::OwnedView<UpdateExternalLocationRequestView<'static>> {
fn from(wrapper: UpdateExternalLocationRequestOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<UpdateExternalLocationRequestView<'static>>,
> for UpdateExternalLocationRequestOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<UpdateExternalLocationRequestView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::UpdateExternalLocationRequest {
type View<'a> = UpdateExternalLocationRequestView<'a>;
type ViewHandle = UpdateExternalLocationRequestOwnedView;
}
impl ::serde::Serialize for UpdateExternalLocationRequestOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
#[derive(Clone, Debug, Default)]
pub struct DeleteExternalLocationRequestView<'a> {
pub name: &'a str,
pub force: ::core::option::Option<bool>,
pub __buffa_unknown_fields: ::buffa::UnknownFieldsView<'a>,
}
impl<'a> DeleteExternalLocationRequestView<'a> {
#[doc(hidden)]
pub fn _decode_depth(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
let mut view = Self::default();
view._merge_into_view(buf, depth)?;
::core::result::Result::Ok(view)
}
#[doc(hidden)]
pub fn _merge_into_view(
&mut self,
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<(), ::buffa::DecodeError> {
let _ = depth;
#[allow(unused_variables)]
let view = self;
let mut cur: &'a [u8] = buf;
while !cur.is_empty() {
let before_tag = cur;
let tag = ::buffa::encoding::Tag::decode(&mut cur)?;
match tag.field_number() {
1u32 => {
if tag.wire_type()
!= ::buffa::encoding::WireType::LengthDelimited
{
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 1u32,
expected: 2u8,
actual: tag.wire_type() as u8,
});
}
view.name = ::buffa::types::borrow_str(&mut cur)?;
}
2u32 => {
if tag.wire_type() != ::buffa::encoding::WireType::Varint {
return ::core::result::Result::Err(::buffa::DecodeError::WireTypeMismatch {
field_number: 2u32,
expected: 0u8,
actual: tag.wire_type() as u8,
});
}
view.force = Some(::buffa::types::decode_bool(&mut cur)?);
}
_ => {
::buffa::encoding::skip_field_depth(tag, &mut cur, depth)?;
let span_len = before_tag.len() - cur.len();
view.__buffa_unknown_fields
.push_raw(&before_tag[..span_len]);
}
}
}
::core::result::Result::Ok(())
}
}
impl<'a> ::buffa::MessageView<'a> for DeleteExternalLocationRequestView<'a> {
type Owned = super::super::DeleteExternalLocationRequest;
fn decode_view(
buf: &'a [u8],
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, ::buffa::RECURSION_LIMIT)
}
fn decode_view_with_limit(
buf: &'a [u8],
depth: u32,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
Self::_decode_depth(buf, depth)
}
fn to_owned_message(&self) -> super::super::DeleteExternalLocationRequest {
self.to_owned_from_source(None)
}
#[allow(clippy::useless_conversion, clippy::needless_update)]
fn to_owned_from_source(
&self,
__buffa_src: ::core::option::Option<&::buffa::bytes::Bytes>,
) -> super::super::DeleteExternalLocationRequest {
#[allow(unused_imports)]
use ::buffa::alloc::string::ToString as _;
let _ = __buffa_src;
super::super::DeleteExternalLocationRequest {
name: self.name.to_string(),
force: self.force,
__buffa_unknown_fields: self
.__buffa_unknown_fields
.to_owned()
.unwrap_or_default()
.into(),
..::core::default::Default::default()
}
}
}
impl<'a> ::buffa::ViewEncode<'a> for DeleteExternalLocationRequestView<'a> {
#[allow(clippy::needless_borrow, clippy::let_and_return)]
fn compute_size(&self, _cache: &mut ::buffa::SizeCache) -> u32 {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
let mut size = 0u32;
if !self.name.is_empty() {
size += 1u32 + ::buffa::types::string_encoded_len(&self.name) as u32;
}
if self.force.is_some() {
size += 1u32 + ::buffa::types::BOOL_ENCODED_LEN as u32;
}
size += self.__buffa_unknown_fields.encoded_len() as u32;
size
}
#[allow(clippy::needless_borrow)]
fn write_to(
&self,
_cache: &mut ::buffa::SizeCache,
buf: &mut impl ::buffa::bytes::BufMut,
) {
#[allow(unused_imports)]
use ::buffa::Enumeration as _;
if !self.name.is_empty() {
::buffa::encoding::Tag::new(
1u32,
::buffa::encoding::WireType::LengthDelimited,
)
.encode(buf);
::buffa::types::encode_string(&self.name, buf);
}
if let Some(v) = self.force {
::buffa::encoding::Tag::new(
2u32,
::buffa::encoding::WireType::Varint,
)
.encode(buf);
::buffa::types::encode_bool(v, buf);
}
self.__buffa_unknown_fields.write_to(buf);
}
}
impl<'__a> ::serde::Serialize for DeleteExternalLocationRequestView<'__a> {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
use ::serde::ser::SerializeMap as _;
let mut __map = __s.serialize_map(::core::option::Option::None)?;
if !::buffa::json_helpers::skip_if::is_empty_str(self.name) {
__map.serialize_entry("name", self.name)?;
}
if let ::core::option::Option::Some(__v) = self.force {
__map.serialize_entry("force", &__v)?;
}
__map.end()
}
}
impl<'a> ::buffa::MessageName for DeleteExternalLocationRequestView<'a> {
const PACKAGE: &'static str = "unitycatalog.external_locations.v1";
const NAME: &'static str = "DeleteExternalLocationRequest";
const FULL_NAME: &'static str = "unitycatalog.external_locations.v1.DeleteExternalLocationRequest";
const TYPE_URL: &'static str = "type.googleapis.com/unitycatalog.external_locations.v1.DeleteExternalLocationRequest";
}
impl<'v> ::buffa::DefaultViewInstance for DeleteExternalLocationRequestView<'v> {
fn default_view_instance<'a>() -> &'a Self
where
Self: 'a,
{
static VALUE: ::buffa::__private::OnceBox<
DeleteExternalLocationRequestView<'static>,
> = ::buffa::__private::OnceBox::new();
VALUE
.get_or_init(|| ::buffa::alloc::boxed::Box::new(
<DeleteExternalLocationRequestView<'static>>::default(),
))
}
}
impl ::buffa::ViewReborrow for DeleteExternalLocationRequestView<'static> {
type Reborrowed<'b> = DeleteExternalLocationRequestView<'b>;
fn reborrow<'b>(this: &'b Self) -> &'b Self::Reborrowed<'b> {
this
}
}
#[derive(Clone, Debug)]
pub struct DeleteExternalLocationRequestOwnedView(
::buffa::OwnedView<DeleteExternalLocationRequestView<'static>>,
);
impl DeleteExternalLocationRequestOwnedView {
pub fn decode(
bytes: ::buffa::bytes::Bytes,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
DeleteExternalLocationRequestOwnedView(
::buffa::OwnedView::decode(bytes)?,
),
)
}
pub fn decode_with_options(
bytes: ::buffa::bytes::Bytes,
opts: &::buffa::DecodeOptions,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
DeleteExternalLocationRequestOwnedView(
::buffa::OwnedView::decode_with_options(bytes, opts)?,
),
)
}
pub fn from_owned(
msg: &super::super::DeleteExternalLocationRequest,
) -> ::core::result::Result<Self, ::buffa::DecodeError> {
::core::result::Result::Ok(
DeleteExternalLocationRequestOwnedView(
::buffa::OwnedView::from_owned(msg)?,
),
)
}
#[must_use]
pub fn view(&self) -> &DeleteExternalLocationRequestView<'_> {
self.0.reborrow()
}
#[must_use]
pub fn to_owned_message(
&self,
) -> super::super::DeleteExternalLocationRequest {
self.0.to_owned_message()
}
#[must_use]
pub fn bytes(&self) -> &::buffa::bytes::Bytes {
self.0.bytes()
}
#[must_use]
pub fn into_bytes(self) -> ::buffa::bytes::Bytes {
self.0.into_bytes()
}
#[must_use]
pub fn name(&self) -> &'_ str {
self.0.reborrow().name
}
#[must_use]
pub fn force(&self) -> ::core::option::Option<bool> {
self.0.reborrow().force
}
}
impl ::core::convert::From<
::buffa::OwnedView<DeleteExternalLocationRequestView<'static>>,
> for DeleteExternalLocationRequestOwnedView {
fn from(
inner: ::buffa::OwnedView<DeleteExternalLocationRequestView<'static>>,
) -> Self {
DeleteExternalLocationRequestOwnedView(inner)
}
}
impl ::core::convert::From<DeleteExternalLocationRequestOwnedView>
for ::buffa::OwnedView<DeleteExternalLocationRequestView<'static>> {
fn from(wrapper: DeleteExternalLocationRequestOwnedView) -> Self {
wrapper.0
}
}
impl ::core::convert::AsRef<
::buffa::OwnedView<DeleteExternalLocationRequestView<'static>>,
> for DeleteExternalLocationRequestOwnedView {
fn as_ref(
&self,
) -> &::buffa::OwnedView<DeleteExternalLocationRequestView<'static>> {
&self.0
}
}
impl ::buffa::HasMessageView for super::super::DeleteExternalLocationRequest {
type View<'a> = DeleteExternalLocationRequestView<'a>;
type ViewHandle = DeleteExternalLocationRequestOwnedView;
}
impl ::serde::Serialize for DeleteExternalLocationRequestOwnedView {
fn serialize<__S: ::serde::Serializer>(
&self,
__s: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
::serde::Serialize::serialize(&self.0, __s)
}
}
}
pub fn register_types(reg: &mut ::buffa::type_registry::TypeRegistry) {
reg.register_json_any(super::__EXTERNAL_LOCATION_JSON_ANY);
reg.register_json_any(super::__LIST_EXTERNAL_LOCATIONS_REQUEST_JSON_ANY);
reg.register_json_any(super::__LIST_EXTERNAL_LOCATIONS_RESPONSE_JSON_ANY);
reg.register_json_any(super::__CREATE_EXTERNAL_LOCATION_REQUEST_JSON_ANY);
reg.register_json_any(super::__GET_EXTERNAL_LOCATION_REQUEST_JSON_ANY);
reg.register_json_any(super::__UPDATE_EXTERNAL_LOCATION_REQUEST_JSON_ANY);
reg.register_json_any(super::__DELETE_EXTERNAL_LOCATION_REQUEST_JSON_ANY);
}
}
#[doc(inline)]
pub use self::__buffa::view::ExternalLocationView;
#[doc(inline)]
pub use self::__buffa::view::ExternalLocationOwnedView;
#[doc(inline)]
pub use self::__buffa::view::ListExternalLocationsRequestView;
#[doc(inline)]
pub use self::__buffa::view::ListExternalLocationsRequestOwnedView;
#[doc(inline)]
pub use self::__buffa::view::ListExternalLocationsResponseView;
#[doc(inline)]
pub use self::__buffa::view::ListExternalLocationsResponseOwnedView;
#[doc(inline)]
pub use self::__buffa::view::CreateExternalLocationRequestView;
#[doc(inline)]
pub use self::__buffa::view::CreateExternalLocationRequestOwnedView;
#[doc(inline)]
pub use self::__buffa::view::GetExternalLocationRequestView;
#[doc(inline)]
pub use self::__buffa::view::GetExternalLocationRequestOwnedView;
#[doc(inline)]
pub use self::__buffa::view::UpdateExternalLocationRequestView;
#[doc(inline)]
pub use self::__buffa::view::UpdateExternalLocationRequestOwnedView;
#[doc(inline)]
pub use self::__buffa::view::DeleteExternalLocationRequestView;
#[doc(inline)]
pub use self::__buffa::view::DeleteExternalLocationRequestOwnedView;
#[doc(inline)]
pub use self::__buffa::register_types;