Xuanwo commented on code in PR #5548:
URL: https://github.com/apache/opendal/pull/5548#discussion_r1916558730


##########
core/src/services/gcs/core.rs:
##########
@@ -193,6 +197,10 @@ impl GcsCore {
 
         let mut req = Request::get(&url);
 
+        if let Some(version) = args.version() {
+            req = req.header(constants::GENERATION, version);

Review Comment:
   `generation` is a query parameter: 
https://cloud.google.com/storage/docs/json_api/v1/objects/get



##########
core/src/services/gcs/core.rs:
##########
@@ -534,6 +561,54 @@ impl GcsCore {
         self.send(req).await
     }
 
+    pub async fn gcs_list_object_versions(

Review Comment:
   The output is the same for GCS. Perhaps we don't need to split it into two 
functions?



##########
core/src/services/gcs/core.rs:
##########
@@ -439,18 +459,25 @@ impl GcsCore {
             percent_encode_path(&p)
         );
 
-        Request::delete(&url)
-            .body(Buffer::new())
-            .map_err(new_request_build_error)
+        let mut req = Request::delete(&url);
+
+        if let Some(version) = args.version() {
+            req = req.header(constants::GENERATION, version);

Review Comment:
   `generation` is a query parameter.



##########
core/src/services/gcs/core.rs:
##########
@@ -397,6 +413,10 @@ impl GcsCore {
 
         let mut req = Request::head(&url);
 
+        if let Some(version) = args.version() {
+            req = req.header(constants::X_GOOG_IF_GENERATION_MATCH, version);

Review Comment:
   The same.



##########
core/src/services/gcs/core.rs:
##########
@@ -372,6 +384,10 @@ impl GcsCore {
 
         let mut req = Request::get(&url);
 
+        if let Some(version) = args.version() {
+            req = req.header(constants::IF_GENERATION_MATCH, version);

Review Comment:
   `IF_GENERATION_MATCH` is used for conditional check, it's not the version.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to