Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accepting generic Stream implementation of storage_objects_insert_ext_stream #157

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ pub type BoxStreamWithSend<'a, T> = std::pin::Pin<Box<dyn futures::Stream<Item =
/// Stores a new object and metadata.
/// Open API doesn't support binary streams and this particular endpoint uses another base URL.
/// Tha means generated `storage_objects_insert` can't be used.
pub async fn storage_objects_insert_ext_stream(
pub async fn storage_objects_insert_ext_stream<S>(
configuration: &configuration::Configuration,
params: StoragePeriodObjectsPeriodInsertParams,
content_type: Option<String>,
bytes_stream: BoxStreamWithSync<
'static,
std::result::Result<bytes::Bytes, Box<(dyn std::error::Error + Send + Sync + 'static)>>,
>
bytes_stream: S,
) -> Result<
crate::google_rest_apis::storage_v1::models::Object,
Error<StoragePeriodObjectsPeriodInsertError>,
> {
> where S: futures::stream::TryStream + Send + Sync + 'static,
S::Error: Into<Box<dyn std::error::Error + Send + Sync>>,
Bytes: From<S::Ok> {
let local_var_configuration = configuration;

// unbox the parameters
Expand Down
13 changes: 8 additions & 5 deletions gcloud-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ google-actions-sdk-v2-interactionmodel-prompt = []
google-actions-sdk-v2-interactionmodel-type = []
google-actions-type = []
google-ads-admob-v1 = []
google-ads-googleads-v15-common = []
google-ads-googleads-v15-enums = []
google-ads-googleads-v15-errors = []
google-ads-googleads-v15-resources = []
google-ads-googleads-v15-services = []
google-ads-googleads-v16-common = []
google-ads-googleads-v16-enums = []
google-ads-googleads-v16-errors = []
google-ads-googleads-v16-resources = []
google-ads-googleads-v16-services = []
google-analytics-admin-v1alpha = []
google-analytics-admin-v1beta = []
google-analytics-data-v1beta = []
Expand Down Expand Up @@ -400,6 +400,7 @@ google-rpc-context = []
google-search-partnerdataingestion-logging-v1 = []
google-spanner-admin-database-v1 = []
google-spanner-admin-instance-v1 = []
google-spanner-executor-v1 = []
google-spanner-v1 = []
google-storage-v1 = []
google-storage-v2 = []
Expand All @@ -416,6 +417,8 @@ grafeas-v1beta1-image = []
grafeas-v1beta1-package = []
grafeas-v1beta1-provenance = []
grafeas-v1beta1-source = []
grafeas-v1beta1-vulnerability = []
grafeas-v1beta1-discovery = []
maps-fleetengine-v1 = []

# REST features
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use bytes::Bytes;
use serde::{Deserialize, Serialize}; /*
* Cloud Storage JSON API
*
Expand Down Expand Up @@ -2386,18 +2387,17 @@ pub type BoxStreamWithSend<'a, T> = std::pin::Pin<Box<dyn futures::Stream<Item =
/// Stores a new object and metadata.
/// Open API doesn't support binary streams and this particular endpoint uses another base URL.
/// Tha means generated `storage_objects_insert` can't be used.
pub async fn storage_objects_insert_ext_stream(
pub async fn storage_objects_insert_ext_stream<S>(
configuration: &configuration::Configuration,
params: StoragePeriodObjectsPeriodInsertParams,
content_type: Option<String>,
bytes_stream: BoxStreamWithSync<
'static,
std::result::Result<bytes::Bytes, Box<(dyn std::error::Error + Send + Sync + 'static)>>,
>,
bytes_stream: S,
) -> Result<
crate::google_rest_apis::storage_v1::models::Object,
Error<StoragePeriodObjectsPeriodInsertError>,
> {
> where S: futures::stream::TryStream + Send + Sync + 'static,
S::Error: Into<Box<dyn std::error::Error + Send + Sync>>,
Bytes: From<S::Ok> {
let local_var_configuration = configuration;

// unbox the parameters
Expand Down
Loading