@@ -32,10 +32,103 @@ class ListResult:
32
32
def objects (self ) -> list [ObjectMeta ]:
33
33
"""Object metadata for the listing"""
34
34
35
+ class ClientOptions :
36
+ """HTTP client configuration for remote object stores"""
37
+
38
+ @property
39
+ def user_agent (self ) -> str | None :
40
+ """Sets the User-Agent header to be used by this client
41
+
42
+ Default is based on the version of this crate
43
+ """
44
+ @property
45
+ def default_content_type (self ) -> str | None :
46
+ """Set the default CONTENT_TYPE for uploads"""
47
+ @property
48
+ def proxy_url (self ) -> str | None :
49
+ """Set an HTTP proxy to use for requests"""
50
+ @property
51
+ def allow_http (self ) -> bool :
52
+ """Sets what protocol is allowed.
53
+
54
+ If `allow_http` is :
55
+ * false (default): Only HTTPS ise allowed
56
+ * true: HTTP and HTTPS are allowed
57
+ """
58
+ @property
59
+ def allow_insecure (self ) -> bool :
60
+ """Allows connections to invalid SSL certificates
61
+ * false (default): Only valid HTTPS certificates are allowed
62
+ * true: All HTTPS certificates are allowed
63
+
64
+ # Warning
65
+
66
+ You should think very carefully before using this method. If
67
+ invalid certificates are trusted, *any* certificate for *any* site
68
+ will be trusted for use. This includes expired certificates. This
69
+ introduces significant vulnerabilities, and should only be used
70
+ as a last resort or for testing.
71
+ """
72
+ @property
73
+ def timeout (self ) -> int :
74
+ """Set a request timeout (seconds)
75
+
76
+ The timeout is applied from when the request starts connecting until the
77
+ response body has finished
78
+ """
79
+ @property
80
+ def connect_timeout (self ) -> int :
81
+ """Set a timeout (seconds) for only the connect phase of a Client"""
82
+ @property
83
+ def pool_idle_timeout (self ) -> int :
84
+ """Set the pool max idle timeout (seconds)
85
+
86
+ This is the length of time an idle connection will be kept alive
87
+
88
+ Default is 90 seconds
89
+ """
90
+ @property
91
+ def pool_max_idle_per_host (self ) -> int :
92
+ """Set the maximum number of idle connections per host
93
+
94
+ Default is no limit"""
95
+ @property
96
+ def http2_keep_alive_interval (self ) -> int :
97
+ """Sets an interval for HTTP2 Ping frames should be sent to keep a connection alive.
98
+
99
+ Default is disabled
100
+ """
101
+ @property
102
+ def http2_keep_alive_timeout (self ) -> int :
103
+ """Sets a timeout for receiving an acknowledgement of the keep-alive ping.
104
+
105
+ If the ping is not acknowledged within the timeout, the connection will be closed.
106
+ Does nothing if http2_keep_alive_interval is disabled.
107
+
108
+ Default is disabled
109
+ """
110
+ @property
111
+ def http2_keep_alive_while_idle (self ) -> bool :
112
+ """Enable HTTP2 keep alive pings for idle connections
113
+
114
+ If disabled, keep-alive pings are only sent while there are open request/response
115
+ streams. If enabled, pings are also sent when no streams are active
116
+
117
+ Default is disabled
118
+ """
119
+ @property
120
+ def http1_only (self ) -> bool :
121
+ """Only use http1 connections"""
122
+ @property
123
+ def http2_only (self ) -> bool :
124
+ """Only use http2 connections"""
125
+
35
126
class ObjectStore :
36
127
"""A uniform API for interacting with object storage services and local files."""
37
128
38
- def __init__ (self , root : str , options : dict [str , str ] | None = None ) -> None : ...
129
+ def __init__ (
130
+ self , root : str , options : dict [str , str ] | None = None , client_options : ClientOptions | None = None
131
+ ) -> None : ...
39
132
def get (self , location : Path ) -> bytes :
40
133
"""Return the bytes that are stored at the specified location."""
41
134
def get_range (self , location : Path , start : int , length : int ) -> bytes :
@@ -115,7 +208,9 @@ class ObjectOutputStream:
115
208
class ArrowFileSystemHandler :
116
209
"""Implementation of pyarrow.fs.FileSystemHandler for use with pyarrow.fs.PyFileSystem"""
117
210
118
- def __init__ (self , root : str , options : dict [str , str ] | None = None ) -> None : ...
211
+ def __init__ (
212
+ self , root : str , options : dict [str , str ] | None = None , client_options : ClientOptions | None = None
213
+ ) -> None : ...
119
214
def copy_file (self , src : str , dst : str ) -> None :
120
215
"""Copy a file.
121
216
0 commit comments