impl gaxi::prost::ToProto<FindingType> for crate::generated::gapic_control::model::FindingType {
type Output = i32;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
self.value().ok_or(gaxi::prost::ConvertError::EnumNoIntegerValue("crate::generated::gapic_control::model::FindingType"))
}
}
impl gaxi::prost::ToProto<FindingCategory> for crate::generated::gapic_control::model::FindingCategory {
type Output = i32;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
self.value().ok_or(gaxi::prost::ConvertError::EnumNoIntegerValue("crate::generated::gapic_control::model::FindingCategory"))
}
}
impl gaxi::prost::ToProto<FindingSeverity> for crate::generated::gapic_control::model::FindingSeverity {
type Output = i32;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
self.value().ok_or(gaxi::prost::ConvertError::EnumNoIntegerValue("crate::generated::gapic_control::model::FindingSeverity"))
}
}
impl gaxi::prost::ToProto<PendingRenameInfo> for crate::generated::gapic_control::model::PendingRenameInfo {
type Output = PendingRenameInfo;
fn to_proto(self) -> std::result::Result<PendingRenameInfo, gaxi::prost::ConvertError> {
Ok(Self::Output {
operation: self.operation.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::PendingRenameInfo> for PendingRenameInfo {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::PendingRenameInfo, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::PendingRenameInfo::new()
.set_operation(self.operation)
)
}
}
impl gaxi::prost::ToProto<Folder> for crate::generated::gapic_control::model::Folder {
type Output = Folder;
fn to_proto(self) -> std::result::Result<Folder, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
metageneration: self.metageneration.to_proto()?,
create_time: self.create_time.map(|v| v.to_proto()).transpose()?,
update_time: self.update_time.map(|v| v.to_proto()).transpose()?,
pending_rename_info: self.pending_rename_info.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::Folder> for Folder {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::Folder, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::Folder::new()
.set_name(self.name)
.set_metageneration(self.metageneration)
.set_or_clear_create_time(self.create_time.map(|v| v.cnv()).transpose()?)
.set_or_clear_update_time(self.update_time.map(|v| v.cnv()).transpose()?)
.set_or_clear_pending_rename_info(self.pending_rename_info.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<GetFolderRequest> for crate::generated::gapic_control::model::GetFolderRequest {
type Output = GetFolderRequest;
fn to_proto(self) -> std::result::Result<GetFolderRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
if_metageneration_match: self.if_metageneration_match.map(|v| v.to_proto()).transpose()?,
if_metageneration_not_match: self.if_metageneration_not_match.map(|v| v.to_proto()).transpose()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::GetFolderRequest> for GetFolderRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::GetFolderRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::GetFolderRequest::new()
.set_name(self.name)
.set_or_clear_if_metageneration_match(self.if_metageneration_match.map(|v| v.cnv()).transpose()?)
.set_or_clear_if_metageneration_not_match(self.if_metageneration_not_match.map(|v| v.cnv()).transpose()?)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<CreateFolderRequest> for crate::generated::gapic_control::model::CreateFolderRequest {
type Output = CreateFolderRequest;
fn to_proto(self) -> std::result::Result<CreateFolderRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
parent: self.parent.to_proto()?,
folder: self.folder.map(|v| v.to_proto()).transpose()?,
folder_id: self.folder_id.to_proto()?,
recursive: self.recursive.to_proto()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::CreateFolderRequest> for CreateFolderRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::CreateFolderRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::CreateFolderRequest::new()
.set_parent(self.parent)
.set_or_clear_folder(self.folder.map(|v| v.cnv()).transpose()?)
.set_folder_id(self.folder_id)
.set_recursive(self.recursive)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<DeleteFolderRequest> for crate::generated::gapic_control::model::DeleteFolderRequest {
type Output = DeleteFolderRequest;
fn to_proto(self) -> std::result::Result<DeleteFolderRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
if_metageneration_match: self.if_metageneration_match.map(|v| v.to_proto()).transpose()?,
if_metageneration_not_match: self.if_metageneration_not_match.map(|v| v.to_proto()).transpose()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::DeleteFolderRequest> for DeleteFolderRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::DeleteFolderRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::DeleteFolderRequest::new()
.set_name(self.name)
.set_or_clear_if_metageneration_match(self.if_metageneration_match.map(|v| v.cnv()).transpose()?)
.set_or_clear_if_metageneration_not_match(self.if_metageneration_not_match.map(|v| v.cnv()).transpose()?)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<ListFoldersRequest> for crate::generated::gapic_control::model::ListFoldersRequest {
type Output = ListFoldersRequest;
fn to_proto(self) -> std::result::Result<ListFoldersRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
parent: self.parent.to_proto()?,
page_size: self.page_size.to_proto()?,
page_token: self.page_token.to_proto()?,
prefix: self.prefix.to_proto()?,
delimiter: self.delimiter.to_proto()?,
lexicographic_start: self.lexicographic_start.to_proto()?,
lexicographic_end: self.lexicographic_end.to_proto()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::ListFoldersRequest> for ListFoldersRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::ListFoldersRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::ListFoldersRequest::new()
.set_parent(self.parent)
.set_page_size(self.page_size)
.set_page_token(self.page_token)
.set_prefix(self.prefix)
.set_delimiter(self.delimiter)
.set_lexicographic_start(self.lexicographic_start)
.set_lexicographic_end(self.lexicographic_end)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<ListFoldersResponse> for crate::generated::gapic_control::model::ListFoldersResponse {
type Output = ListFoldersResponse;
fn to_proto(self) -> std::result::Result<ListFoldersResponse, gaxi::prost::ConvertError> {
Ok(Self::Output {
folders: self.folders
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
next_page_token: self.next_page_token.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::ListFoldersResponse> for ListFoldersResponse {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::ListFoldersResponse, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::ListFoldersResponse::new()
.set_folders(self.folders.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
.set_next_page_token(self.next_page_token)
)
}
}
impl gaxi::prost::ToProto<RenameFolderRequest> for crate::generated::gapic_control::model::RenameFolderRequest {
type Output = RenameFolderRequest;
fn to_proto(self) -> std::result::Result<RenameFolderRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
destination_folder_id: self.destination_folder_id.to_proto()?,
if_metageneration_match: self.if_metageneration_match.map(|v| v.to_proto()).transpose()?,
if_metageneration_not_match: self.if_metageneration_not_match.map(|v| v.to_proto()).transpose()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::RenameFolderRequest> for RenameFolderRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::RenameFolderRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::RenameFolderRequest::new()
.set_name(self.name)
.set_destination_folder_id(self.destination_folder_id)
.set_or_clear_if_metageneration_match(self.if_metageneration_match.map(|v| v.cnv()).transpose()?)
.set_or_clear_if_metageneration_not_match(self.if_metageneration_not_match.map(|v| v.cnv()).transpose()?)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<DeleteFolderRecursiveRequest> for crate::generated::gapic_control::model::DeleteFolderRecursiveRequest {
type Output = DeleteFolderRecursiveRequest;
fn to_proto(self) -> std::result::Result<DeleteFolderRecursiveRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
if_metageneration_match: self.if_metageneration_match.map(|v| v.to_proto()).transpose()?,
if_metageneration_not_match: self.if_metageneration_not_match.map(|v| v.to_proto()).transpose()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::DeleteFolderRecursiveRequest> for DeleteFolderRecursiveRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::DeleteFolderRecursiveRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::DeleteFolderRecursiveRequest::new()
.set_name(self.name)
.set_or_clear_if_metageneration_match(self.if_metageneration_match.map(|v| v.cnv()).transpose()?)
.set_or_clear_if_metageneration_not_match(self.if_metageneration_not_match.map(|v| v.cnv()).transpose()?)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<CommonLongRunningOperationMetadata> for crate::generated::gapic_control::model::CommonLongRunningOperationMetadata {
type Output = CommonLongRunningOperationMetadata;
fn to_proto(self) -> std::result::Result<CommonLongRunningOperationMetadata, gaxi::prost::ConvertError> {
Ok(Self::Output {
create_time: self.create_time.map(|v| v.to_proto()).transpose()?,
end_time: self.end_time.map(|v| v.to_proto()).transpose()?,
update_time: self.update_time.map(|v| v.to_proto()).transpose()?,
r#type: self.r#type.to_proto()?,
requested_cancellation: self.requested_cancellation.to_proto()?,
progress_percent: self.progress_percent.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::CommonLongRunningOperationMetadata> for CommonLongRunningOperationMetadata {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::CommonLongRunningOperationMetadata, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::CommonLongRunningOperationMetadata::new()
.set_or_clear_create_time(self.create_time.map(|v| v.cnv()).transpose()?)
.set_or_clear_end_time(self.end_time.map(|v| v.cnv()).transpose()?)
.set_or_clear_update_time(self.update_time.map(|v| v.cnv()).transpose()?)
.set_type(self.r#type)
.set_requested_cancellation(self.requested_cancellation)
.set_progress_percent(self.progress_percent)
)
}
}
impl gaxi::prost::ToProto<RenameFolderMetadata> for crate::generated::gapic_control::model::RenameFolderMetadata {
type Output = RenameFolderMetadata;
fn to_proto(self) -> std::result::Result<RenameFolderMetadata, gaxi::prost::ConvertError> {
Ok(Self::Output {
common_metadata: self.common_metadata.map(|v| v.to_proto()).transpose()?,
source_folder_id: self.source_folder_id.to_proto()?,
destination_folder_id: self.destination_folder_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::RenameFolderMetadata> for RenameFolderMetadata {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::RenameFolderMetadata, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::RenameFolderMetadata::new()
.set_or_clear_common_metadata(self.common_metadata.map(|v| v.cnv()).transpose()?)
.set_source_folder_id(self.source_folder_id)
.set_destination_folder_id(self.destination_folder_id)
)
}
}
impl gaxi::prost::ToProto<DeleteFolderRecursiveMetadata> for crate::generated::gapic_control::model::DeleteFolderRecursiveMetadata {
type Output = DeleteFolderRecursiveMetadata;
fn to_proto(self) -> std::result::Result<DeleteFolderRecursiveMetadata, gaxi::prost::ConvertError> {
Ok(Self::Output {
common_metadata: self.common_metadata.map(|v| v.to_proto()).transpose()?,
folder_id: self.folder_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::DeleteFolderRecursiveMetadata> for DeleteFolderRecursiveMetadata {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::DeleteFolderRecursiveMetadata, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::DeleteFolderRecursiveMetadata::new()
.set_or_clear_common_metadata(self.common_metadata.map(|v| v.cnv()).transpose()?)
.set_folder_id(self.folder_id)
)
}
}
impl gaxi::prost::ToProto<storage_layout::CustomPlacementConfig> for crate::generated::gapic_control::model::storage_layout::CustomPlacementConfig {
type Output = storage_layout::CustomPlacementConfig;
fn to_proto(self) -> std::result::Result<storage_layout::CustomPlacementConfig, gaxi::prost::ConvertError> {
Ok(Self::Output {
data_locations: self.data_locations
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::storage_layout::CustomPlacementConfig> for storage_layout::CustomPlacementConfig {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::storage_layout::CustomPlacementConfig, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::storage_layout::CustomPlacementConfig::new()
.set_data_locations(self.data_locations.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
)
}
}
impl gaxi::prost::ToProto<storage_layout::HierarchicalNamespace> for crate::generated::gapic_control::model::storage_layout::HierarchicalNamespace {
type Output = storage_layout::HierarchicalNamespace;
fn to_proto(self) -> std::result::Result<storage_layout::HierarchicalNamespace, gaxi::prost::ConvertError> {
Ok(Self::Output {
enabled: self.enabled.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::storage_layout::HierarchicalNamespace> for storage_layout::HierarchicalNamespace {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::storage_layout::HierarchicalNamespace, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::storage_layout::HierarchicalNamespace::new()
.set_enabled(self.enabled)
)
}
}
impl gaxi::prost::ToProto<StorageLayout> for crate::generated::gapic_control::model::StorageLayout {
type Output = StorageLayout;
fn to_proto(self) -> std::result::Result<StorageLayout, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
location: self.location.to_proto()?,
location_type: self.location_type.to_proto()?,
custom_placement_config: self.custom_placement_config.map(|v| v.to_proto()).transpose()?,
hierarchical_namespace: self.hierarchical_namespace.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::StorageLayout> for StorageLayout {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::StorageLayout, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::StorageLayout::new()
.set_name(self.name)
.set_location(self.location)
.set_location_type(self.location_type)
.set_or_clear_custom_placement_config(self.custom_placement_config.map(|v| v.cnv()).transpose()?)
.set_or_clear_hierarchical_namespace(self.hierarchical_namespace.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<GetStorageLayoutRequest> for crate::generated::gapic_control::model::GetStorageLayoutRequest {
type Output = GetStorageLayoutRequest;
fn to_proto(self) -> std::result::Result<GetStorageLayoutRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
prefix: self.prefix.to_proto()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::GetStorageLayoutRequest> for GetStorageLayoutRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::GetStorageLayoutRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::GetStorageLayoutRequest::new()
.set_name(self.name)
.set_prefix(self.prefix)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<ManagedFolder> for crate::generated::gapic_control::model::ManagedFolder {
type Output = ManagedFolder;
fn to_proto(self) -> std::result::Result<ManagedFolder, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
metageneration: self.metageneration.to_proto()?,
create_time: self.create_time.map(|v| v.to_proto()).transpose()?,
update_time: self.update_time.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::ManagedFolder> for ManagedFolder {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::ManagedFolder, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::ManagedFolder::new()
.set_name(self.name)
.set_metageneration(self.metageneration)
.set_or_clear_create_time(self.create_time.map(|v| v.cnv()).transpose()?)
.set_or_clear_update_time(self.update_time.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<GetManagedFolderRequest> for crate::generated::gapic_control::model::GetManagedFolderRequest {
type Output = GetManagedFolderRequest;
fn to_proto(self) -> std::result::Result<GetManagedFolderRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
if_metageneration_match: self.if_metageneration_match.map(|v| v.to_proto()).transpose()?,
if_metageneration_not_match: self.if_metageneration_not_match.map(|v| v.to_proto()).transpose()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::GetManagedFolderRequest> for GetManagedFolderRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::GetManagedFolderRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::GetManagedFolderRequest::new()
.set_name(self.name)
.set_or_clear_if_metageneration_match(self.if_metageneration_match.map(|v| v.cnv()).transpose()?)
.set_or_clear_if_metageneration_not_match(self.if_metageneration_not_match.map(|v| v.cnv()).transpose()?)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<CreateManagedFolderRequest> for crate::generated::gapic_control::model::CreateManagedFolderRequest {
type Output = CreateManagedFolderRequest;
fn to_proto(self) -> std::result::Result<CreateManagedFolderRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
parent: self.parent.to_proto()?,
managed_folder: self.managed_folder.map(|v| v.to_proto()).transpose()?,
managed_folder_id: self.managed_folder_id.to_proto()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::CreateManagedFolderRequest> for CreateManagedFolderRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::CreateManagedFolderRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::CreateManagedFolderRequest::new()
.set_parent(self.parent)
.set_or_clear_managed_folder(self.managed_folder.map(|v| v.cnv()).transpose()?)
.set_managed_folder_id(self.managed_folder_id)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<DeleteManagedFolderRequest> for crate::generated::gapic_control::model::DeleteManagedFolderRequest {
type Output = DeleteManagedFolderRequest;
fn to_proto(self) -> std::result::Result<DeleteManagedFolderRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
if_metageneration_match: self.if_metageneration_match.map(|v| v.to_proto()).transpose()?,
if_metageneration_not_match: self.if_metageneration_not_match.map(|v| v.to_proto()).transpose()?,
allow_non_empty: self.allow_non_empty.to_proto()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::DeleteManagedFolderRequest> for DeleteManagedFolderRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::DeleteManagedFolderRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::DeleteManagedFolderRequest::new()
.set_name(self.name)
.set_or_clear_if_metageneration_match(self.if_metageneration_match.map(|v| v.cnv()).transpose()?)
.set_or_clear_if_metageneration_not_match(self.if_metageneration_not_match.map(|v| v.cnv()).transpose()?)
.set_allow_non_empty(self.allow_non_empty)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<ListManagedFoldersRequest> for crate::generated::gapic_control::model::ListManagedFoldersRequest {
type Output = ListManagedFoldersRequest;
fn to_proto(self) -> std::result::Result<ListManagedFoldersRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
parent: self.parent.to_proto()?,
page_size: self.page_size.to_proto()?,
page_token: self.page_token.to_proto()?,
prefix: self.prefix.to_proto()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::ListManagedFoldersRequest> for ListManagedFoldersRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::ListManagedFoldersRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::ListManagedFoldersRequest::new()
.set_parent(self.parent)
.set_page_size(self.page_size)
.set_page_token(self.page_token)
.set_prefix(self.prefix)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<ListManagedFoldersResponse> for crate::generated::gapic_control::model::ListManagedFoldersResponse {
type Output = ListManagedFoldersResponse;
fn to_proto(self) -> std::result::Result<ListManagedFoldersResponse, gaxi::prost::ConvertError> {
Ok(Self::Output {
managed_folders: self.managed_folders
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
next_page_token: self.next_page_token.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::ListManagedFoldersResponse> for ListManagedFoldersResponse {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::ListManagedFoldersResponse, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::ListManagedFoldersResponse::new()
.set_managed_folders(self.managed_folders.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
.set_next_page_token(self.next_page_token)
)
}
}
impl gaxi::prost::ToProto<CreateAnywhereCacheMetadata> for crate::generated::gapic_control::model::CreateAnywhereCacheMetadata {
type Output = CreateAnywhereCacheMetadata;
fn to_proto(self) -> std::result::Result<CreateAnywhereCacheMetadata, gaxi::prost::ConvertError> {
Ok(Self::Output {
common_metadata: self.common_metadata.map(|v| v.to_proto()).transpose()?,
anywhere_cache_id: self.anywhere_cache_id.map(|v| v.to_proto()).transpose()?,
zone: self.zone.map(|v| v.to_proto()).transpose()?,
ttl: self.ttl.map(|v| v.to_proto()).transpose()?,
admission_policy: self.admission_policy.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::CreateAnywhereCacheMetadata> for CreateAnywhereCacheMetadata {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::CreateAnywhereCacheMetadata, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::CreateAnywhereCacheMetadata::new()
.set_or_clear_common_metadata(self.common_metadata.map(|v| v.cnv()).transpose()?)
.set_or_clear_anywhere_cache_id(self.anywhere_cache_id.map(|v| v.cnv()).transpose()?)
.set_or_clear_zone(self.zone.map(|v| v.cnv()).transpose()?)
.set_or_clear_ttl(self.ttl.map(|v| v.cnv()).transpose()?)
.set_or_clear_admission_policy(self.admission_policy.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<UpdateAnywhereCacheMetadata> for crate::generated::gapic_control::model::UpdateAnywhereCacheMetadata {
type Output = UpdateAnywhereCacheMetadata;
fn to_proto(self) -> std::result::Result<UpdateAnywhereCacheMetadata, gaxi::prost::ConvertError> {
Ok(Self::Output {
common_metadata: self.common_metadata.map(|v| v.to_proto()).transpose()?,
anywhere_cache_id: self.anywhere_cache_id.map(|v| v.to_proto()).transpose()?,
zone: self.zone.map(|v| v.to_proto()).transpose()?,
ttl: self.ttl.map(|v| v.to_proto()).transpose()?,
admission_policy: self.admission_policy.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::UpdateAnywhereCacheMetadata> for UpdateAnywhereCacheMetadata {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::UpdateAnywhereCacheMetadata, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::UpdateAnywhereCacheMetadata::new()
.set_or_clear_common_metadata(self.common_metadata.map(|v| v.cnv()).transpose()?)
.set_or_clear_anywhere_cache_id(self.anywhere_cache_id.map(|v| v.cnv()).transpose()?)
.set_or_clear_zone(self.zone.map(|v| v.cnv()).transpose()?)
.set_or_clear_ttl(self.ttl.map(|v| v.cnv()).transpose()?)
.set_or_clear_admission_policy(self.admission_policy.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<AnywhereCache> for crate::generated::gapic_control::model::AnywhereCache {
type Output = AnywhereCache;
fn to_proto(self) -> std::result::Result<AnywhereCache, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
zone: self.zone.to_proto()?,
ttl: self.ttl.map(|v| v.to_proto()).transpose()?,
admission_policy: self.admission_policy.to_proto()?,
state: self.state.to_proto()?,
create_time: self.create_time.map(|v| v.to_proto()).transpose()?,
update_time: self.update_time.map(|v| v.to_proto()).transpose()?,
pending_update: self.pending_update.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::AnywhereCache> for AnywhereCache {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::AnywhereCache, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::AnywhereCache::new()
.set_name(self.name)
.set_zone(self.zone)
.set_or_clear_ttl(self.ttl.map(|v| v.cnv()).transpose()?)
.set_admission_policy(self.admission_policy)
.set_state(self.state)
.set_or_clear_create_time(self.create_time.map(|v| v.cnv()).transpose()?)
.set_or_clear_update_time(self.update_time.map(|v| v.cnv()).transpose()?)
.set_pending_update(self.pending_update)
)
}
}
impl gaxi::prost::ToProto<CreateAnywhereCacheRequest> for crate::generated::gapic_control::model::CreateAnywhereCacheRequest {
type Output = CreateAnywhereCacheRequest;
fn to_proto(self) -> std::result::Result<CreateAnywhereCacheRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
parent: self.parent.to_proto()?,
anywhere_cache: self.anywhere_cache.map(|v| v.to_proto()).transpose()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::CreateAnywhereCacheRequest> for CreateAnywhereCacheRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::CreateAnywhereCacheRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::CreateAnywhereCacheRequest::new()
.set_parent(self.parent)
.set_or_clear_anywhere_cache(self.anywhere_cache.map(|v| v.cnv()).transpose()?)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<UpdateAnywhereCacheRequest> for crate::generated::gapic_control::model::UpdateAnywhereCacheRequest {
type Output = UpdateAnywhereCacheRequest;
fn to_proto(self) -> std::result::Result<UpdateAnywhereCacheRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
anywhere_cache: self.anywhere_cache.map(|v| v.to_proto()).transpose()?,
update_mask: self.update_mask.map(|v| v.to_proto()).transpose()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::UpdateAnywhereCacheRequest> for UpdateAnywhereCacheRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::UpdateAnywhereCacheRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::UpdateAnywhereCacheRequest::new()
.set_or_clear_anywhere_cache(self.anywhere_cache.map(|v| v.cnv()).transpose()?)
.set_or_clear_update_mask(self.update_mask.map(|v| v.cnv()).transpose()?)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<DisableAnywhereCacheRequest> for crate::generated::gapic_control::model::DisableAnywhereCacheRequest {
type Output = DisableAnywhereCacheRequest;
fn to_proto(self) -> std::result::Result<DisableAnywhereCacheRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::DisableAnywhereCacheRequest> for DisableAnywhereCacheRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::DisableAnywhereCacheRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::DisableAnywhereCacheRequest::new()
.set_name(self.name)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<PauseAnywhereCacheRequest> for crate::generated::gapic_control::model::PauseAnywhereCacheRequest {
type Output = PauseAnywhereCacheRequest;
fn to_proto(self) -> std::result::Result<PauseAnywhereCacheRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::PauseAnywhereCacheRequest> for PauseAnywhereCacheRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::PauseAnywhereCacheRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::PauseAnywhereCacheRequest::new()
.set_name(self.name)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<ResumeAnywhereCacheRequest> for crate::generated::gapic_control::model::ResumeAnywhereCacheRequest {
type Output = ResumeAnywhereCacheRequest;
fn to_proto(self) -> std::result::Result<ResumeAnywhereCacheRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::ResumeAnywhereCacheRequest> for ResumeAnywhereCacheRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::ResumeAnywhereCacheRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::ResumeAnywhereCacheRequest::new()
.set_name(self.name)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<GetAnywhereCacheRequest> for crate::generated::gapic_control::model::GetAnywhereCacheRequest {
type Output = GetAnywhereCacheRequest;
fn to_proto(self) -> std::result::Result<GetAnywhereCacheRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::GetAnywhereCacheRequest> for GetAnywhereCacheRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::GetAnywhereCacheRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::GetAnywhereCacheRequest::new()
.set_name(self.name)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<ListAnywhereCachesRequest> for crate::generated::gapic_control::model::ListAnywhereCachesRequest {
type Output = ListAnywhereCachesRequest;
fn to_proto(self) -> std::result::Result<ListAnywhereCachesRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
parent: self.parent.to_proto()?,
page_size: self.page_size.to_proto()?,
page_token: self.page_token.to_proto()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::ListAnywhereCachesRequest> for ListAnywhereCachesRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::ListAnywhereCachesRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::ListAnywhereCachesRequest::new()
.set_parent(self.parent)
.set_page_size(self.page_size)
.set_page_token(self.page_token)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<ListAnywhereCachesResponse> for crate::generated::gapic_control::model::ListAnywhereCachesResponse {
type Output = ListAnywhereCachesResponse;
fn to_proto(self) -> std::result::Result<ListAnywhereCachesResponse, gaxi::prost::ConvertError> {
Ok(Self::Output {
anywhere_caches: self.anywhere_caches
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
next_page_token: self.next_page_token.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::ListAnywhereCachesResponse> for ListAnywhereCachesResponse {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::ListAnywhereCachesResponse, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::ListAnywhereCachesResponse::new()
.set_anywhere_caches(self.anywhere_caches.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
.set_next_page_token(self.next_page_token)
)
}
}
impl gaxi::prost::ToProto<intelligence_config::filter::CloudStorageLocations> for crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageLocations {
type Output = intelligence_config::filter::CloudStorageLocations;
fn to_proto(self) -> std::result::Result<intelligence_config::filter::CloudStorageLocations, gaxi::prost::ConvertError> {
Ok(Self::Output {
locations: self.locations
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageLocations> for intelligence_config::filter::CloudStorageLocations {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageLocations, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageLocations::new()
.set_locations(self.locations.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_config::filter::CloudStorageBuckets> for crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageBuckets {
type Output = intelligence_config::filter::CloudStorageBuckets;
fn to_proto(self) -> std::result::Result<intelligence_config::filter::CloudStorageBuckets, gaxi::prost::ConvertError> {
Ok(Self::Output {
bucket_id_regexes: self.bucket_id_regexes
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageBuckets> for intelligence_config::filter::CloudStorageBuckets {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageBuckets, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageBuckets::new()
.set_bucket_id_regexes(self.bucket_id_regexes.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_config::filter::CloudStorageLocationsOneOf> for crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageLocationsOneOf {
type Output = intelligence_config::filter::CloudStorageLocationsOneOf;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
match self {
Self::IncludedCloudStorageLocations(v) => Ok(Self::Output::IncludedCloudStorageLocations((*v).to_proto()?)),
Self::ExcludedCloudStorageLocations(v) => Ok(Self::Output::ExcludedCloudStorageLocations((*v).to_proto()?)),
}
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageLocationsOneOf> for intelligence_config::filter::CloudStorageLocationsOneOf {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageLocationsOneOf, gaxi::prost::ConvertError> {
use crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageLocationsOneOf as T;
match self {
Self::IncludedCloudStorageLocations(v) => Ok(T::from_included_cloud_storage_locations(v.cnv()?)),
Self::ExcludedCloudStorageLocations(v) => Ok(T::from_excluded_cloud_storage_locations(v.cnv()?)),
}
}
}
impl gaxi::prost::ToProto<intelligence_config::filter::CloudStorageBucketsOneOf> for crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageBucketsOneOf {
type Output = intelligence_config::filter::CloudStorageBucketsOneOf;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
match self {
Self::IncludedCloudStorageBuckets(v) => Ok(Self::Output::IncludedCloudStorageBuckets((*v).to_proto()?)),
Self::ExcludedCloudStorageBuckets(v) => Ok(Self::Output::ExcludedCloudStorageBuckets((*v).to_proto()?)),
}
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageBucketsOneOf> for intelligence_config::filter::CloudStorageBucketsOneOf {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageBucketsOneOf, gaxi::prost::ConvertError> {
use crate::generated::gapic_control::model::intelligence_config::filter::CloudStorageBucketsOneOf as T;
match self {
Self::IncludedCloudStorageBuckets(v) => Ok(T::from_included_cloud_storage_buckets(v.cnv()?)),
Self::ExcludedCloudStorageBuckets(v) => Ok(T::from_excluded_cloud_storage_buckets(v.cnv()?)),
}
}
}
impl gaxi::prost::ToProto<intelligence_config::Filter> for crate::generated::gapic_control::model::intelligence_config::Filter {
type Output = intelligence_config::Filter;
fn to_proto(self) -> std::result::Result<intelligence_config::Filter, gaxi::prost::ConvertError> {
Ok(Self::Output {
cloud_storage_locations: self.cloud_storage_locations.map(|v| v.to_proto()).transpose()?,
cloud_storage_buckets: self.cloud_storage_buckets.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_config::Filter> for intelligence_config::Filter {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_config::Filter, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_config::Filter::new()
.set_cloud_storage_locations(self.cloud_storage_locations.map(|v| v.cnv()).transpose()?)
.set_cloud_storage_buckets(self.cloud_storage_buckets.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_config::effective_intelligence_config::EffectiveEdition> for crate::generated::gapic_control::model::intelligence_config::effective_intelligence_config::EffectiveEdition {
type Output = i32;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
self.value().ok_or(gaxi::prost::ConvertError::EnumNoIntegerValue("crate::generated::gapic_control::model::intelligence_config::effective_intelligence_config::EffectiveEdition"))
}
}
impl gaxi::prost::ToProto<intelligence_config::EffectiveIntelligenceConfig> for crate::generated::gapic_control::model::intelligence_config::EffectiveIntelligenceConfig {
type Output = intelligence_config::EffectiveIntelligenceConfig;
fn to_proto(self) -> std::result::Result<intelligence_config::EffectiveIntelligenceConfig, gaxi::prost::ConvertError> {
Ok(Self::Output {
effective_edition: self.effective_edition.to_proto()?,
intelligence_config: self.intelligence_config.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_config::EffectiveIntelligenceConfig> for intelligence_config::EffectiveIntelligenceConfig {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_config::EffectiveIntelligenceConfig, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_config::EffectiveIntelligenceConfig::new()
.set_effective_edition(self.effective_edition)
.set_intelligence_config(self.intelligence_config)
)
}
}
impl gaxi::prost::ToProto<intelligence_config::TrialConfig> for crate::generated::gapic_control::model::intelligence_config::TrialConfig {
type Output = intelligence_config::TrialConfig;
fn to_proto(self) -> std::result::Result<intelligence_config::TrialConfig, gaxi::prost::ConvertError> {
Ok(Self::Output {
expire_time: self.expire_time.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_config::TrialConfig> for intelligence_config::TrialConfig {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_config::TrialConfig, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_config::TrialConfig::new()
.set_or_clear_expire_time(self.expire_time.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_config::EditionConfig> for crate::generated::gapic_control::model::intelligence_config::EditionConfig {
type Output = i32;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
self.value().ok_or(gaxi::prost::ConvertError::EnumNoIntegerValue("crate::generated::gapic_control::model::intelligence_config::EditionConfig"))
}
}
impl gaxi::prost::ToProto<IntelligenceConfig> for crate::generated::gapic_control::model::IntelligenceConfig {
type Output = IntelligenceConfig;
fn to_proto(self) -> std::result::Result<IntelligenceConfig, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
edition_config: self.edition_config.to_proto()?,
update_time: self.update_time.map(|v| v.to_proto()).transpose()?,
filter: self.filter.map(|v| v.to_proto()).transpose()?,
effective_intelligence_config: self.effective_intelligence_config.map(|v| v.to_proto()).transpose()?,
trial_config: self.trial_config.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::IntelligenceConfig> for IntelligenceConfig {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::IntelligenceConfig, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::IntelligenceConfig::new()
.set_name(self.name)
.set_edition_config(self.edition_config)
.set_or_clear_update_time(self.update_time.map(|v| v.cnv()).transpose()?)
.set_or_clear_filter(self.filter.map(|v| v.cnv()).transpose()?)
.set_or_clear_effective_intelligence_config(self.effective_intelligence_config.map(|v| v.cnv()).transpose()?)
.set_or_clear_trial_config(self.trial_config.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<UpdateOrganizationIntelligenceConfigRequest> for crate::generated::gapic_control::model::UpdateOrganizationIntelligenceConfigRequest {
type Output = UpdateOrganizationIntelligenceConfigRequest;
fn to_proto(self) -> std::result::Result<UpdateOrganizationIntelligenceConfigRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
intelligence_config: self.intelligence_config.map(|v| v.to_proto()).transpose()?,
update_mask: self.update_mask.map(|v| v.to_proto()).transpose()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::UpdateOrganizationIntelligenceConfigRequest> for UpdateOrganizationIntelligenceConfigRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::UpdateOrganizationIntelligenceConfigRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::UpdateOrganizationIntelligenceConfigRequest::new()
.set_or_clear_intelligence_config(self.intelligence_config.map(|v| v.cnv()).transpose()?)
.set_or_clear_update_mask(self.update_mask.map(|v| v.cnv()).transpose()?)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<UpdateFolderIntelligenceConfigRequest> for crate::generated::gapic_control::model::UpdateFolderIntelligenceConfigRequest {
type Output = UpdateFolderIntelligenceConfigRequest;
fn to_proto(self) -> std::result::Result<UpdateFolderIntelligenceConfigRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
intelligence_config: self.intelligence_config.map(|v| v.to_proto()).transpose()?,
update_mask: self.update_mask.map(|v| v.to_proto()).transpose()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::UpdateFolderIntelligenceConfigRequest> for UpdateFolderIntelligenceConfigRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::UpdateFolderIntelligenceConfigRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::UpdateFolderIntelligenceConfigRequest::new()
.set_or_clear_intelligence_config(self.intelligence_config.map(|v| v.cnv()).transpose()?)
.set_or_clear_update_mask(self.update_mask.map(|v| v.cnv()).transpose()?)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<UpdateProjectIntelligenceConfigRequest> for crate::generated::gapic_control::model::UpdateProjectIntelligenceConfigRequest {
type Output = UpdateProjectIntelligenceConfigRequest;
fn to_proto(self) -> std::result::Result<UpdateProjectIntelligenceConfigRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
intelligence_config: self.intelligence_config.map(|v| v.to_proto()).transpose()?,
update_mask: self.update_mask.map(|v| v.to_proto()).transpose()?,
request_id: self.request_id.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::UpdateProjectIntelligenceConfigRequest> for UpdateProjectIntelligenceConfigRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::UpdateProjectIntelligenceConfigRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::UpdateProjectIntelligenceConfigRequest::new()
.set_or_clear_intelligence_config(self.intelligence_config.map(|v| v.cnv()).transpose()?)
.set_or_clear_update_mask(self.update_mask.map(|v| v.cnv()).transpose()?)
.set_request_id(self.request_id)
)
}
}
impl gaxi::prost::ToProto<GetOrganizationIntelligenceConfigRequest> for crate::generated::gapic_control::model::GetOrganizationIntelligenceConfigRequest {
type Output = GetOrganizationIntelligenceConfigRequest;
fn to_proto(self) -> std::result::Result<GetOrganizationIntelligenceConfigRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::GetOrganizationIntelligenceConfigRequest> for GetOrganizationIntelligenceConfigRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::GetOrganizationIntelligenceConfigRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::GetOrganizationIntelligenceConfigRequest::new()
.set_name(self.name)
)
}
}
impl gaxi::prost::ToProto<GetFolderIntelligenceConfigRequest> for crate::generated::gapic_control::model::GetFolderIntelligenceConfigRequest {
type Output = GetFolderIntelligenceConfigRequest;
fn to_proto(self) -> std::result::Result<GetFolderIntelligenceConfigRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::GetFolderIntelligenceConfigRequest> for GetFolderIntelligenceConfigRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::GetFolderIntelligenceConfigRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::GetFolderIntelligenceConfigRequest::new()
.set_name(self.name)
)
}
}
impl gaxi::prost::ToProto<GetProjectIntelligenceConfigRequest> for crate::generated::gapic_control::model::GetProjectIntelligenceConfigRequest {
type Output = GetProjectIntelligenceConfigRequest;
fn to_proto(self) -> std::result::Result<GetProjectIntelligenceConfigRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::GetProjectIntelligenceConfigRequest> for GetProjectIntelligenceConfigRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::GetProjectIntelligenceConfigRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::GetProjectIntelligenceConfigRequest::new()
.set_name(self.name)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution> for crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution {
type Output = intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution;
fn to_proto(self) -> std::result::Result<intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution, gaxi::prost::ConvertError> {
Ok(Self::Output {
prefix: self.prefix.to_proto()?,
percentage_increase: self.percentage_increase.to_proto()?,
total_operations_count: self.total_operations_count.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution> for intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::contribution::PrefixContribution::new()
.set_prefix(self.prefix)
.set_percentage_increase(self.percentage_increase)
.set_total_operations_count(self.total_operations_count)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution> for crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution {
type Output = intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution;
fn to_proto(self) -> std::result::Result<intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution, gaxi::prost::ConvertError> {
Ok(Self::Output {
top_prefixes: self.top_prefixes
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution> for intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Contribution::new()
.set_top_prefixes(self.top_prefixes.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details> for crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details {
type Output = intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
match self {
Self::Contribution(v) => Ok(Self::Output::Contribution((*v).to_proto()?)),
Self::Error(v) => Ok(Self::Output::Error((*v).to_proto()?)),
}
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details> for intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details, gaxi::prost::ConvertError> {
use crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::bucket_contribution::Details as T;
match self {
Self::Contribution(v) => Ok(T::from_contribution(v.cnv()?)),
Self::Error(v) => Ok(T::from_error(v.cnv()?)),
}
}
}
impl gaxi::prost::ToProto<intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution> for crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution {
type Output = intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution;
fn to_proto(self) -> std::result::Result<intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution, gaxi::prost::ConvertError> {
Ok(Self::Output {
bucket: self.bucket.to_proto()?,
percentage_increase: self.percentage_increase.to_proto()?,
total_operations_count: self.total_operations_count.to_proto()?,
details: self.details.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution> for intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::coldline_and_archival_storage_operations_spike::BucketContribution::new()
.set_bucket(self.bucket)
.set_percentage_increase(self.percentage_increase)
.set_total_operations_count(self.total_operations_count)
.set_details(self.details.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::ColdlineAndArchivalStorageOperationsSpike> for crate::generated::gapic_control::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike {
type Output = intelligence_finding::ColdlineAndArchivalStorageOperationsSpike;
fn to_proto(self) -> std::result::Result<intelligence_finding::ColdlineAndArchivalStorageOperationsSpike, gaxi::prost::ConvertError> {
Ok(Self::Output {
percentage_increase: self.percentage_increase.to_proto()?,
total_operations_count: self.total_operations_count.to_proto()?,
top_buckets: self.top_buckets
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike> for intelligence_finding::ColdlineAndArchivalStorageOperationsSpike {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::ColdlineAndArchivalStorageOperationsSpike::new()
.set_percentage_increase(self.percentage_increase)
.set_total_operations_count(self.total_operations_count)
.set_top_buckets(self.top_buckets.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution> for crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution {
type Output = intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution;
fn to_proto(self) -> std::result::Result<intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution, gaxi::prost::ConvertError> {
Ok(Self::Output {
prefix: self.prefix.to_proto()?,
total_egress_bytes: self.total_egress_bytes.to_proto()?,
percentage_increase: self.percentage_increase.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution> for intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::contribution::PrefixContribution::new()
.set_prefix(self.prefix)
.set_total_egress_bytes(self.total_egress_bytes)
.set_percentage_increase(self.percentage_increase)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution> for crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution {
type Output = intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution;
fn to_proto(self) -> std::result::Result<intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution, gaxi::prost::ConvertError> {
Ok(Self::Output {
top_prefixes: self.top_prefixes
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution> for intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Contribution::new()
.set_top_prefixes(self.top_prefixes.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::cross_region_egress_spike::bucket_contribution::Details> for crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details {
type Output = intelligence_finding::cross_region_egress_spike::bucket_contribution::Details;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
match self {
Self::Contribution(v) => Ok(Self::Output::Contribution((*v).to_proto()?)),
Self::Error(v) => Ok(Self::Output::Error((*v).to_proto()?)),
}
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details> for intelligence_finding::cross_region_egress_spike::bucket_contribution::Details {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details, gaxi::prost::ConvertError> {
use crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::bucket_contribution::Details as T;
match self {
Self::Contribution(v) => Ok(T::from_contribution(v.cnv()?)),
Self::Error(v) => Ok(T::from_error(v.cnv()?)),
}
}
}
impl gaxi::prost::ToProto<intelligence_finding::cross_region_egress_spike::BucketContribution> for crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::BucketContribution {
type Output = intelligence_finding::cross_region_egress_spike::BucketContribution;
fn to_proto(self) -> std::result::Result<intelligence_finding::cross_region_egress_spike::BucketContribution, gaxi::prost::ConvertError> {
Ok(Self::Output {
bucket: self.bucket.to_proto()?,
total_egress_bytes: self.total_egress_bytes.to_proto()?,
percentage_increase: self.percentage_increase.to_proto()?,
details: self.details.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::BucketContribution> for intelligence_finding::cross_region_egress_spike::BucketContribution {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::BucketContribution, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::cross_region_egress_spike::BucketContribution::new()
.set_bucket(self.bucket)
.set_total_egress_bytes(self.total_egress_bytes)
.set_percentage_increase(self.percentage_increase)
.set_details(self.details.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::CrossRegionEgressSpike> for crate::generated::gapic_control::model::intelligence_finding::CrossRegionEgressSpike {
type Output = intelligence_finding::CrossRegionEgressSpike;
fn to_proto(self) -> std::result::Result<intelligence_finding::CrossRegionEgressSpike, gaxi::prost::ConvertError> {
Ok(Self::Output {
total_egress_bytes: self.total_egress_bytes.to_proto()?,
percentage_increase: self.percentage_increase.to_proto()?,
top_buckets: self.top_buckets
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::CrossRegionEgressSpike> for intelligence_finding::CrossRegionEgressSpike {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::CrossRegionEgressSpike, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::CrossRegionEgressSpike::new()
.set_total_egress_bytes(self.total_egress_bytes)
.set_percentage_increase(self.percentage_increase)
.set_top_buckets(self.top_buckets.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution> for crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution {
type Output = intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution;
fn to_proto(self) -> std::result::Result<intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution, gaxi::prost::ConvertError> {
Ok(Self::Output {
prefix: self.prefix.to_proto()?,
throttled_requests: self.throttled_requests.to_proto()?,
percentage_increase: self.percentage_increase.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution> for intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::bucket_contribution::contribution::PrefixContribution::new()
.set_prefix(self.prefix)
.set_throttled_requests(self.throttled_requests)
.set_percentage_increase(self.percentage_increase)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::throttled_request_spike::bucket_contribution::Contribution> for crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution {
type Output = intelligence_finding::throttled_request_spike::bucket_contribution::Contribution;
fn to_proto(self) -> std::result::Result<intelligence_finding::throttled_request_spike::bucket_contribution::Contribution, gaxi::prost::ConvertError> {
Ok(Self::Output {
top_prefixes: self.top_prefixes
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution> for intelligence_finding::throttled_request_spike::bucket_contribution::Contribution {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::bucket_contribution::Contribution::new()
.set_top_prefixes(self.top_prefixes.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::throttled_request_spike::bucket_contribution::Details> for crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details {
type Output = intelligence_finding::throttled_request_spike::bucket_contribution::Details;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
match self {
Self::Contribution(v) => Ok(Self::Output::Contribution((*v).to_proto()?)),
Self::Error(v) => Ok(Self::Output::Error((*v).to_proto()?)),
}
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details> for intelligence_finding::throttled_request_spike::bucket_contribution::Details {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details, gaxi::prost::ConvertError> {
use crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::bucket_contribution::Details as T;
match self {
Self::Contribution(v) => Ok(T::from_contribution(v.cnv()?)),
Self::Error(v) => Ok(T::from_error(v.cnv()?)),
}
}
}
impl gaxi::prost::ToProto<intelligence_finding::throttled_request_spike::BucketContribution> for crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::BucketContribution {
type Output = intelligence_finding::throttled_request_spike::BucketContribution;
fn to_proto(self) -> std::result::Result<intelligence_finding::throttled_request_spike::BucketContribution, gaxi::prost::ConvertError> {
Ok(Self::Output {
bucket: self.bucket.to_proto()?,
throttled_requests: self.throttled_requests.to_proto()?,
percentage_increase: self.percentage_increase.to_proto()?,
details: self.details.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::BucketContribution> for intelligence_finding::throttled_request_spike::BucketContribution {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::BucketContribution, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::throttled_request_spike::BucketContribution::new()
.set_bucket(self.bucket)
.set_throttled_requests(self.throttled_requests)
.set_percentage_increase(self.percentage_increase)
.set_details(self.details.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::ThrottledRequestSpike> for crate::generated::gapic_control::model::intelligence_finding::ThrottledRequestSpike {
type Output = intelligence_finding::ThrottledRequestSpike;
fn to_proto(self) -> std::result::Result<intelligence_finding::ThrottledRequestSpike, gaxi::prost::ConvertError> {
Ok(Self::Output {
throttled_requests: self.throttled_requests.to_proto()?,
percentage_increase: self.percentage_increase.to_proto()?,
top_buckets: self.top_buckets
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::ThrottledRequestSpike> for intelligence_finding::ThrottledRequestSpike {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::ThrottledRequestSpike, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::ThrottledRequestSpike::new()
.set_throttled_requests(self.throttled_requests)
.set_percentage_increase(self.percentage_increase)
.set_top_buckets(self.top_buckets.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::storage_growth_above_trend::bucket_contribution::Details> for crate::generated::gapic_control::model::intelligence_finding::storage_growth_above_trend::bucket_contribution::Details {
type Output = intelligence_finding::storage_growth_above_trend::bucket_contribution::Details;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
match self {
Self::Error(v) => Ok(Self::Output::Error((*v).to_proto()?)),
}
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::storage_growth_above_trend::bucket_contribution::Details> for intelligence_finding::storage_growth_above_trend::bucket_contribution::Details {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::storage_growth_above_trend::bucket_contribution::Details, gaxi::prost::ConvertError> {
use crate::generated::gapic_control::model::intelligence_finding::storage_growth_above_trend::bucket_contribution::Details as T;
match self {
Self::Error(v) => Ok(T::from_error(v.cnv()?)),
}
}
}
impl gaxi::prost::ToProto<intelligence_finding::storage_growth_above_trend::BucketContribution> for crate::generated::gapic_control::model::intelligence_finding::storage_growth_above_trend::BucketContribution {
type Output = intelligence_finding::storage_growth_above_trend::BucketContribution;
fn to_proto(self) -> std::result::Result<intelligence_finding::storage_growth_above_trend::BucketContribution, gaxi::prost::ConvertError> {
Ok(Self::Output {
bucket: self.bucket.to_proto()?,
total_storage_growth_bytes: self.total_storage_growth_bytes.to_proto()?,
percentage_increase: self.percentage_increase.to_proto()?,
details: self.details.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::storage_growth_above_trend::BucketContribution> for intelligence_finding::storage_growth_above_trend::BucketContribution {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::storage_growth_above_trend::BucketContribution, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::storage_growth_above_trend::BucketContribution::new()
.set_bucket(self.bucket)
.set_total_storage_growth_bytes(self.total_storage_growth_bytes)
.set_percentage_increase(self.percentage_increase)
.set_details(self.details.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::StorageGrowthAboveTrend> for crate::generated::gapic_control::model::intelligence_finding::StorageGrowthAboveTrend {
type Output = intelligence_finding::StorageGrowthAboveTrend;
fn to_proto(self) -> std::result::Result<intelligence_finding::StorageGrowthAboveTrend, gaxi::prost::ConvertError> {
Ok(Self::Output {
total_storage_growth_bytes: self.total_storage_growth_bytes.to_proto()?,
percentage_increase: self.percentage_increase.to_proto()?,
top_buckets: self.top_buckets
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::StorageGrowthAboveTrend> for intelligence_finding::StorageGrowthAboveTrend {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::StorageGrowthAboveTrend, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::intelligence_finding::StorageGrowthAboveTrend::new()
.set_total_storage_growth_bytes(self.total_storage_growth_bytes)
.set_percentage_increase(self.percentage_increase)
.set_top_buckets(self.top_buckets.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
)
}
}
impl gaxi::prost::ToProto<intelligence_finding::IntelligenceFindingDetails> for crate::generated::gapic_control::model::intelligence_finding::IntelligenceFindingDetails {
type Output = intelligence_finding::IntelligenceFindingDetails;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
match self {
Self::ColdlineAndArchivalStorageOperationsSpike(v) => Ok(Self::Output::ColdlineAndArchivalStorageOperationsSpike((*v).to_proto()?)),
Self::ThrottledRequestsSpike(v) => Ok(Self::Output::ThrottledRequestsSpike((*v).to_proto()?)),
Self::CrossRegionEgressSpike(v) => Ok(Self::Output::CrossRegionEgressSpike((*v).to_proto()?)),
Self::StorageGrowthAboveTrend(v) => Ok(Self::Output::StorageGrowthAboveTrend((*v).to_proto()?)),
}
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::intelligence_finding::IntelligenceFindingDetails> for intelligence_finding::IntelligenceFindingDetails {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::intelligence_finding::IntelligenceFindingDetails, gaxi::prost::ConvertError> {
use crate::generated::gapic_control::model::intelligence_finding::IntelligenceFindingDetails as T;
match self {
Self::ColdlineAndArchivalStorageOperationsSpike(v) => Ok(T::from_coldline_and_archival_storage_operations_spike(v.cnv()?)),
Self::ThrottledRequestsSpike(v) => Ok(T::from_throttled_requests_spike(v.cnv()?)),
Self::CrossRegionEgressSpike(v) => Ok(T::from_cross_region_egress_spike(v.cnv()?)),
Self::StorageGrowthAboveTrend(v) => Ok(T::from_storage_growth_above_trend(v.cnv()?)),
}
}
}
impl gaxi::prost::ToProto<IntelligenceFinding> for crate::generated::gapic_control::model::IntelligenceFinding {
type Output = IntelligenceFinding;
fn to_proto(self) -> std::result::Result<IntelligenceFinding, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
description: self.description.to_proto()?,
r#type: self.r#type.to_proto()?,
category: self.category.to_proto()?,
severity: self.severity.to_proto()?,
create_time: self.create_time.map(|v| v.to_proto()).transpose()?,
update_time: self.update_time.map(|v| v.to_proto()).transpose()?,
target_resource: self.target_resource.to_proto()?,
associated_resources: self.associated_resources
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
observation_period: self.observation_period.map(|v| v.to_proto()).transpose()?,
intelligence_finding_details: self.intelligence_finding_details.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::IntelligenceFinding> for IntelligenceFinding {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::IntelligenceFinding, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::IntelligenceFinding::new()
.set_name(self.name)
.set_description(self.description)
.set_type(self.r#type)
.set_category(self.category)
.set_severity(self.severity)
.set_or_clear_create_time(self.create_time.map(|v| v.cnv()).transpose()?)
.set_or_clear_update_time(self.update_time.map(|v| v.cnv()).transpose()?)
.set_target_resource(self.target_resource)
.set_associated_resources(self.associated_resources.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
.set_or_clear_observation_period(self.observation_period.map(|v| v.cnv()).transpose()?)
.set_intelligence_finding_details(self.intelligence_finding_details.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<IntelligenceFindingRevision> for crate::generated::gapic_control::model::IntelligenceFindingRevision {
type Output = IntelligenceFindingRevision;
fn to_proto(self) -> std::result::Result<IntelligenceFindingRevision, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
snapshot: self.snapshot.map(|v| v.to_proto()).transpose()?,
create_time: self.create_time.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::IntelligenceFindingRevision> for IntelligenceFindingRevision {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::IntelligenceFindingRevision, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::IntelligenceFindingRevision::new()
.set_name(self.name)
.set_or_clear_snapshot(self.snapshot.map(|v| v.cnv()).transpose()?)
.set_or_clear_create_time(self.create_time.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<GetIntelligenceFindingRequest> for crate::generated::gapic_control::model::GetIntelligenceFindingRequest {
type Output = GetIntelligenceFindingRequest;
fn to_proto(self) -> std::result::Result<GetIntelligenceFindingRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::GetIntelligenceFindingRequest> for GetIntelligenceFindingRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::GetIntelligenceFindingRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::GetIntelligenceFindingRequest::new()
.set_name(self.name)
)
}
}
impl gaxi::prost::ToProto<ListIntelligenceFindingsRequest> for crate::generated::gapic_control::model::ListIntelligenceFindingsRequest {
type Output = ListIntelligenceFindingsRequest;
fn to_proto(self) -> std::result::Result<ListIntelligenceFindingsRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
parent: self.parent.to_proto()?,
filter: self.filter.to_proto()?,
page_size: self.page_size.to_proto()?,
page_token: self.page_token.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::ListIntelligenceFindingsRequest> for ListIntelligenceFindingsRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::ListIntelligenceFindingsRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::ListIntelligenceFindingsRequest::new()
.set_parent(self.parent)
.set_filter(self.filter)
.set_page_size(self.page_size)
.set_page_token(self.page_token)
)
}
}
impl gaxi::prost::ToProto<ListIntelligenceFindingsResponse> for crate::generated::gapic_control::model::ListIntelligenceFindingsResponse {
type Output = ListIntelligenceFindingsResponse;
fn to_proto(self) -> std::result::Result<ListIntelligenceFindingsResponse, gaxi::prost::ConvertError> {
Ok(Self::Output {
intelligence_findings: self.intelligence_findings
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
next_page_token: self.next_page_token.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::ListIntelligenceFindingsResponse> for ListIntelligenceFindingsResponse {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::ListIntelligenceFindingsResponse, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::ListIntelligenceFindingsResponse::new()
.set_intelligence_findings(self.intelligence_findings.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
.set_next_page_token(self.next_page_token)
)
}
}
impl gaxi::prost::ToProto<summarize_intelligence_findings_request::ResourceScope> for crate::generated::gapic_control::model::summarize_intelligence_findings_request::ResourceScope {
type Output = i32;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
self.value().ok_or(gaxi::prost::ConvertError::EnumNoIntegerValue("crate::generated::gapic_control::model::summarize_intelligence_findings_request::ResourceScope"))
}
}
impl gaxi::prost::ToProto<SummarizeIntelligenceFindingsRequest> for crate::generated::gapic_control::model::SummarizeIntelligenceFindingsRequest {
type Output = SummarizeIntelligenceFindingsRequest;
fn to_proto(self) -> std::result::Result<SummarizeIntelligenceFindingsRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
parent: self.parent.to_proto()?,
resource_scope: self.resource_scope.to_proto()?,
filter: self.filter.to_proto()?,
page_size: self.page_size.to_proto()?,
page_token: self.page_token.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::SummarizeIntelligenceFindingsRequest> for SummarizeIntelligenceFindingsRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::SummarizeIntelligenceFindingsRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::SummarizeIntelligenceFindingsRequest::new()
.set_parent(self.parent)
.set_resource_scope(self.resource_scope)
.set_filter(self.filter)
.set_page_size(self.page_size)
.set_page_token(self.page_token)
)
}
}
impl gaxi::prost::ToProto<SummarizeIntelligenceFindingsResponse> for crate::generated::gapic_control::model::SummarizeIntelligenceFindingsResponse {
type Output = SummarizeIntelligenceFindingsResponse;
fn to_proto(self) -> std::result::Result<SummarizeIntelligenceFindingsResponse, gaxi::prost::ConvertError> {
Ok(Self::Output {
finding_summaries: self.finding_summaries
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
next_page_token: self.next_page_token.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::SummarizeIntelligenceFindingsResponse> for SummarizeIntelligenceFindingsResponse {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::SummarizeIntelligenceFindingsResponse, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::SummarizeIntelligenceFindingsResponse::new()
.set_finding_summaries(self.finding_summaries.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
.set_next_page_token(self.next_page_token)
)
}
}
impl gaxi::prost::ToProto<GetIntelligenceFindingRevisionRequest> for crate::generated::gapic_control::model::GetIntelligenceFindingRevisionRequest {
type Output = GetIntelligenceFindingRevisionRequest;
fn to_proto(self) -> std::result::Result<GetIntelligenceFindingRevisionRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
name: self.name.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::GetIntelligenceFindingRevisionRequest> for GetIntelligenceFindingRevisionRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::GetIntelligenceFindingRevisionRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::GetIntelligenceFindingRevisionRequest::new()
.set_name(self.name)
)
}
}
impl gaxi::prost::ToProto<ListIntelligenceFindingRevisionsRequest> for crate::generated::gapic_control::model::ListIntelligenceFindingRevisionsRequest {
type Output = ListIntelligenceFindingRevisionsRequest;
fn to_proto(self) -> std::result::Result<ListIntelligenceFindingRevisionsRequest, gaxi::prost::ConvertError> {
Ok(Self::Output {
parent: self.parent.to_proto()?,
page_size: self.page_size.to_proto()?,
page_token: self.page_token.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::ListIntelligenceFindingRevisionsRequest> for ListIntelligenceFindingRevisionsRequest {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::ListIntelligenceFindingRevisionsRequest, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::ListIntelligenceFindingRevisionsRequest::new()
.set_parent(self.parent)
.set_page_size(self.page_size)
.set_page_token(self.page_token)
)
}
}
impl gaxi::prost::ToProto<ListIntelligenceFindingRevisionsResponse> for crate::generated::gapic_control::model::ListIntelligenceFindingRevisionsResponse {
type Output = ListIntelligenceFindingRevisionsResponse;
fn to_proto(self) -> std::result::Result<ListIntelligenceFindingRevisionsResponse, gaxi::prost::ConvertError> {
Ok(Self::Output {
intelligence_finding_revisions: self.intelligence_finding_revisions
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
next_page_token: self.next_page_token.to_proto()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::ListIntelligenceFindingRevisionsResponse> for ListIntelligenceFindingRevisionsResponse {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::ListIntelligenceFindingRevisionsResponse, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::ListIntelligenceFindingRevisionsResponse::new()
.set_intelligence_finding_revisions(self.intelligence_finding_revisions.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
.set_next_page_token(self.next_page_token)
)
}
}
impl gaxi::prost::ToProto<finding_summary::summary_details::ResourceType> for crate::generated::gapic_control::model::finding_summary::summary_details::ResourceType {
type Output = i32;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
self.value().ok_or(gaxi::prost::ConvertError::EnumNoIntegerValue("crate::generated::gapic_control::model::finding_summary::summary_details::ResourceType"))
}
}
impl gaxi::prost::ToProto<finding_summary::summary_details::Magnitude> for crate::generated::gapic_control::model::finding_summary::summary_details::Magnitude {
type Output = finding_summary::summary_details::Magnitude;
fn to_proto(self) -> std::result::Result<Self::Output, gaxi::prost::ConvertError> {
match self {
Self::Count(v) => Ok(Self::Output::Count(v.to_proto()?)),
Self::Percentage(v) => Ok(Self::Output::Percentage(v.to_proto()?)),
}
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::finding_summary::summary_details::Magnitude> for finding_summary::summary_details::Magnitude {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::finding_summary::summary_details::Magnitude, gaxi::prost::ConvertError> {
use crate::generated::gapic_control::model::finding_summary::summary_details::Magnitude as T;
match self {
Self::Count(v) => Ok(T::from_count(v.cnv()?)),
Self::Percentage(v) => Ok(T::from_percentage(v.cnv()?)),
}
}
}
impl gaxi::prost::ToProto<finding_summary::SummaryDetails> for crate::generated::gapic_control::model::finding_summary::SummaryDetails {
type Output = finding_summary::SummaryDetails;
fn to_proto(self) -> std::result::Result<finding_summary::SummaryDetails, gaxi::prost::ConvertError> {
Ok(Self::Output {
resource_type: self.resource_type.to_proto()?,
description: self.description.to_proto()?,
magnitude: self.magnitude.map(|v| v.to_proto()).transpose()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::finding_summary::SummaryDetails> for finding_summary::SummaryDetails {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::finding_summary::SummaryDetails, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::finding_summary::SummaryDetails::new()
.set_resource_type(self.resource_type)
.set_description(self.description)
.set_magnitude(self.magnitude.map(|v| v.cnv()).transpose()?)
)
}
}
impl gaxi::prost::ToProto<FindingSummary> for crate::generated::gapic_control::model::FindingSummary {
type Output = FindingSummary;
fn to_proto(self) -> std::result::Result<FindingSummary, gaxi::prost::ConvertError> {
Ok(Self::Output {
r#type: self.r#type.to_proto()?,
category: self.category.to_proto()?,
target_resource: self.target_resource.to_proto()?,
create_time: self.create_time.map(|v| v.to_proto()).transpose()?,
update_time: self.update_time.map(|v| v.to_proto()).transpose()?,
severity: self.severity.to_proto()?,
summary_details: self.summary_details
.into_iter()
.map(|v| v.to_proto())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?,
})
}
}
impl gaxi::prost::FromProto<crate::generated::gapic_control::model::FindingSummary> for FindingSummary {
fn cnv(self) -> std::result::Result<crate::generated::gapic_control::model::FindingSummary, gaxi::prost::ConvertError> {
Ok(
crate::generated::gapic_control::model::FindingSummary::new()
.set_type(self.r#type)
.set_category(self.category)
.set_target_resource(self.target_resource)
.set_or_clear_create_time(self.create_time.map(|v| v.cnv()).transpose()?)
.set_or_clear_update_time(self.update_time.map(|v| v.cnv()).transpose()?)
.set_severity(self.severity)
.set_summary_details(self.summary_details.into_iter().map(|v| v.cnv())
.collect::<std::result::Result<std::vec::Vec<_>, _>>()?)
)
}
}