Skip to content

Commit 7b56da0

Browse files
feat: Http proxy
1 parent 600faca commit 7b56da0

File tree

7 files changed

+24
-2
lines changed

7 files changed

+24
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 51
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-a880f2209deafc4a011da42eb52f1dac0308d18ae1daa1d7253edc3385c9b1c4.yml
3-
openapi_spec_hash: ae5af3810d28e49a68b12f2bb2d2af0e
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-8a6175a75caa75c3de5400edf97a34e526ac3f62c63955375437461581deb0c2.yml
3+
openapi_spec_hash: 1a880e4ce337a0e44630e6d87ef5162a
44
config_hash: 49c2ff978aaa5ccb4ce324a72f116010

src/kernel/resources/proxies.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def create(
5151
type: Literal["datacenter", "isp", "residential", "mobile", "custom"],
5252
config: proxy_create_params.Config | Omit = omit,
5353
name: str | Omit = omit,
54+
protocol: Literal["http", "https"] | Omit = omit,
5455
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5556
# The extra values given here take precedence over values defined on the client or passed to this method.
5657
extra_headers: Headers | None = None,
@@ -69,6 +70,8 @@ def create(
6970
7071
name: Readable name of the proxy.
7172
73+
protocol: Protocol to use for the proxy connection.
74+
7275
extra_headers: Send extra headers
7376
7477
extra_query: Add additional query parameters to the request
@@ -84,6 +87,7 @@ def create(
8487
"type": type,
8588
"config": config,
8689
"name": name,
90+
"protocol": protocol,
8791
},
8892
proxy_create_params.ProxyCreateParams,
8993
),
@@ -207,6 +211,7 @@ async def create(
207211
type: Literal["datacenter", "isp", "residential", "mobile", "custom"],
208212
config: proxy_create_params.Config | Omit = omit,
209213
name: str | Omit = omit,
214+
protocol: Literal["http", "https"] | Omit = omit,
210215
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
211216
# The extra values given here take precedence over values defined on the client or passed to this method.
212217
extra_headers: Headers | None = None,
@@ -225,6 +230,8 @@ async def create(
225230
226231
name: Readable name of the proxy.
227232
233+
protocol: Protocol to use for the proxy connection.
234+
228235
extra_headers: Send extra headers
229236
230237
extra_query: Add additional query parameters to the request
@@ -240,6 +247,7 @@ async def create(
240247
"type": type,
241248
"config": config,
242249
"name": name,
250+
"protocol": protocol,
243251
},
244252
proxy_create_params.ProxyCreateParams,
245253
),

src/kernel/types/proxy_create_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class ProxyCreateParams(TypedDict, total=False):
3030
name: str
3131
"""Readable name of the proxy."""
3232

33+
protocol: Literal["http", "https"]
34+
"""Protocol to use for the proxy connection."""
35+
3336

3437
class ConfigDatacenterProxyConfig(TypedDict, total=False):
3538
country: Required[str]

src/kernel/types/proxy_create_response.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,8 @@ class ProxyCreateResponse(BaseModel):
182182
name: Optional[str] = None
183183
"""Readable name of the proxy."""
184184

185+
protocol: Optional[Literal["http", "https"]] = None
186+
"""Protocol to use for the proxy connection."""
187+
185188
status: Optional[Literal["available", "unavailable"]] = None
186189
"""Current health status of the proxy."""

src/kernel/types/proxy_list_response.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ class ProxyListResponseItem(BaseModel):
183183
name: Optional[str] = None
184184
"""Readable name of the proxy."""
185185

186+
protocol: Optional[Literal["http", "https"]] = None
187+
"""Protocol to use for the proxy connection."""
188+
186189
status: Optional[Literal["available", "unavailable"]] = None
187190
"""Current health status of the proxy."""
188191

src/kernel/types/proxy_retrieve_response.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,5 +182,8 @@ class ProxyRetrieveResponse(BaseModel):
182182
name: Optional[str] = None
183183
"""Readable name of the proxy."""
184184

185+
protocol: Optional[Literal["http", "https"]] = None
186+
"""Protocol to use for the proxy connection."""
187+
185188
status: Optional[Literal["available", "unavailable"]] = None
186189
"""Current health status of the proxy."""

tests/api_resources/test_proxies.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def test_method_create_with_all_params(self, client: Kernel) -> None:
3232
type="datacenter",
3333
config={"country": "US"},
3434
name="name",
35+
protocol="http",
3536
)
3637
assert_matches_type(ProxyCreateResponse, proxy, path=["response"])
3738

@@ -194,6 +195,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncKernel) ->
194195
type="datacenter",
195196
config={"country": "US"},
196197
name="name",
198+
protocol="http",
197199
)
198200
assert_matches_type(ProxyCreateResponse, proxy, path=["response"])
199201

0 commit comments

Comments
 (0)