1616// under the License.
1717
1818use dict_derive:: FromPyObject ;
19- use opendal:: { self as ocore, raw:: BytesRange , raw :: Timestamp } ;
19+ use opendal:: { self as ocore, raw:: BytesRange } ;
2020use pyo3:: pyclass;
2121use std:: collections:: HashMap ;
2222
@@ -32,8 +32,8 @@ pub struct ReadOptions {
3232 pub size : Option < usize > ,
3333 pub if_match : Option < String > ,
3434 pub if_none_match : Option < String > ,
35- pub if_modified_since : Option < Timestamp > ,
36- pub if_unmodified_since : Option < Timestamp > ,
35+ pub if_modified_since : Option < String > ,
36+ pub if_unmodified_since : Option < String > ,
3737 pub content_type : Option < String > ,
3838 pub cache_control : Option < String > ,
3939 pub content_disposition : Option < String > ,
@@ -71,8 +71,8 @@ impl From<ReadOptions> for ocore::options::ReadOptions {
7171 version : opts. version ,
7272 if_match : opts. if_match ,
7373 if_none_match : opts. if_none_match ,
74- if_modified_since : opts. if_modified_since ,
75- if_unmodified_since : opts. if_unmodified_since ,
74+ if_modified_since : opts. if_modified_since . and_then ( |s| s . parse ( ) . ok ( ) ) ,
75+ if_unmodified_since : opts. if_unmodified_since . and_then ( |s| s . parse ( ) . ok ( ) ) ,
7676 concurrent : opts. concurrent . unwrap_or_default ( ) ,
7777 chunk : opts. chunk ,
7878 gap : opts. gap ,
@@ -89,8 +89,8 @@ impl From<ReadOptions> for ocore::options::ReaderOptions {
8989 version : opts. version ,
9090 if_match : opts. if_match ,
9191 if_none_match : opts. if_none_match ,
92- if_modified_since : opts. if_modified_since ,
93- if_unmodified_since : opts. if_unmodified_since ,
92+ if_modified_since : opts. if_modified_since . and_then ( |s| s . parse ( ) . ok ( ) ) ,
93+ if_unmodified_since : opts. if_unmodified_since . and_then ( |s| s . parse ( ) . ok ( ) ) ,
9494 concurrent : opts. concurrent . unwrap_or_default ( ) ,
9595 chunk : opts. chunk ,
9696 gap : opts. gap ,
@@ -145,8 +145,8 @@ pub struct StatOptions {
145145 pub version : Option < String > ,
146146 pub if_match : Option < String > ,
147147 pub if_none_match : Option < String > ,
148- pub if_modified_since : Option < Timestamp > ,
149- pub if_unmodified_since : Option < Timestamp > ,
148+ pub if_modified_since : Option < String > ,
149+ pub if_unmodified_since : Option < String > ,
150150 pub content_type : Option < String > ,
151151 pub cache_control : Option < String > ,
152152 pub content_disposition : Option < String > ,
@@ -158,8 +158,8 @@ impl From<StatOptions> for ocore::options::StatOptions {
158158 version : opts. version ,
159159 if_match : opts. if_match ,
160160 if_none_match : opts. if_none_match ,
161- if_modified_since : opts. if_modified_since ,
162- if_unmodified_since : opts. if_unmodified_since ,
161+ if_modified_since : opts. if_modified_since . and_then ( |s| s . parse ( ) . ok ( ) ) ,
162+ if_unmodified_since : opts. if_unmodified_since . and_then ( |s| s . parse ( ) . ok ( ) ) ,
163163 override_content_type : opts. content_type ,
164164 override_cache_control : opts. cache_control ,
165165 override_content_disposition : opts. content_disposition ,
0 commit comments