Skip to content

Commit 55aee7f

Browse files
author
stlc-bot
committed
feat(scrape): list browser profiles and label them with descriptions (#1914)
Stainless-Generated-From: 108a3aac2b51261be99aa43b8aba7d00ae0fcc92
1 parent f54ba9d commit 55aee7f

13 files changed

Lines changed: 591 additions & 2 deletions

File tree

‎.stats.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 44
1+
configured_endpoints: 45

‎api.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,20 @@ Methods:
215215
- <code title="get /org/logs/{request_id}">client.logs.<a href="./src/context/dev/resources/logs.py">retrieve</a>(request_id) -> <a href="./src/context/dev/types/log_retrieve_response.py">LogRetrieveResponse</a></code>
216216
- <code title="get /org/logs">client.logs.<a href="./src/context/dev/resources/logs.py">list</a>(\*\*<a href="src/context/dev/types/log_list_params.py">params</a>) -> <a href="./src/context/dev/types/log_list_response.py">LogListResponse</a></code>
217217

218+
# Browser
219+
220+
## Profiles
221+
222+
Types:
223+
224+
```python
225+
from context.dev.types.browser import ProfileListResponse
226+
```
227+
228+
Methods:
229+
230+
- <code title="get /org/browser/profiles">client.browser.profiles.<a href="./src/context/dev/resources/browser/profiles.py">list</a>(\*\*<a href="src/context/dev/types/browser/profile_list_params.py">params</a>) -> <a href="./src/context/dev/types/browser/profile_list_response.py">ProfileListResponse</a></code>
231+
218232
# Feedback
219233

220234
Types:

‎src/context/dev/_client.py‎

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,21 @@
3535
)
3636

3737
if TYPE_CHECKING:
38-
from .resources import web, logs, news, batch, brand, parse, people, utility, feedback, industry, monitors, webhooks
38+
from .resources import (
39+
web,
40+
logs,
41+
news,
42+
batch,
43+
brand,
44+
parse,
45+
people,
46+
browser,
47+
utility,
48+
feedback,
49+
industry,
50+
monitors,
51+
webhooks,
52+
)
3953
from .resources.web import WebResource, AsyncWebResource
4054
from .resources.logs import LogsResource, AsyncLogsResource
4155
from .resources.news import NewsResource, AsyncNewsResource
@@ -47,6 +61,7 @@
4761
from .resources.feedback import FeedbackResource, AsyncFeedbackResource
4862
from .resources.industry import IndustryResource, AsyncIndustryResource
4963
from .resources.monitors import MonitorsResource, AsyncMonitorsResource
64+
from .resources.browser.browser import BrowserResource, AsyncBrowserResource
5065
from .resources.webhooks.webhooks import WebhooksResource, AsyncWebhooksResource
5166

5267
__all__ = [
@@ -195,6 +210,12 @@ def logs(self) -> LogsResource:
195210

196211
return LogsResource(self)
197212

213+
@cached_property
214+
def browser(self) -> BrowserResource:
215+
from .resources.browser import BrowserResource
216+
217+
return BrowserResource(self)
218+
198219
@cached_property
199220
def feedback(self) -> FeedbackResource:
200221
"""Report API issues and documentation mismatches."""
@@ -449,6 +470,12 @@ def logs(self) -> AsyncLogsResource:
449470

450471
return AsyncLogsResource(self)
451472

473+
@cached_property
474+
def browser(self) -> AsyncBrowserResource:
475+
from .resources.browser import AsyncBrowserResource
476+
477+
return AsyncBrowserResource(self)
478+
452479
@cached_property
453480
def feedback(self) -> AsyncFeedbackResource:
454481
"""Report API issues and documentation mismatches."""
@@ -645,6 +672,12 @@ def logs(self) -> logs.LogsResourceWithRawResponse:
645672

646673
return LogsResourceWithRawResponse(self._client.logs)
647674

675+
@cached_property
676+
def browser(self) -> browser.BrowserResourceWithRawResponse:
677+
from .resources.browser import BrowserResourceWithRawResponse
678+
679+
return BrowserResourceWithRawResponse(self._client.browser)
680+
648681
@cached_property
649682
def feedback(self) -> feedback.FeedbackResourceWithRawResponse:
650683
"""Report API issues and documentation mismatches."""
@@ -729,6 +762,12 @@ def logs(self) -> logs.AsyncLogsResourceWithRawResponse:
729762

730763
return AsyncLogsResourceWithRawResponse(self._client.logs)
731764

765+
@cached_property
766+
def browser(self) -> browser.AsyncBrowserResourceWithRawResponse:
767+
from .resources.browser import AsyncBrowserResourceWithRawResponse
768+
769+
return AsyncBrowserResourceWithRawResponse(self._client.browser)
770+
732771
@cached_property
733772
def feedback(self) -> feedback.AsyncFeedbackResourceWithRawResponse:
734773
"""Report API issues and documentation mismatches."""
@@ -813,6 +852,12 @@ def logs(self) -> logs.LogsResourceWithStreamingResponse:
813852

814853
return LogsResourceWithStreamingResponse(self._client.logs)
815854

855+
@cached_property
856+
def browser(self) -> browser.BrowserResourceWithStreamingResponse:
857+
from .resources.browser import BrowserResourceWithStreamingResponse
858+
859+
return BrowserResourceWithStreamingResponse(self._client.browser)
860+
816861
@cached_property
817862
def feedback(self) -> feedback.FeedbackResourceWithStreamingResponse:
818863
"""Report API issues and documentation mismatches."""
@@ -897,6 +942,12 @@ def logs(self) -> logs.AsyncLogsResourceWithStreamingResponse:
897942

898943
return AsyncLogsResourceWithStreamingResponse(self._client.logs)
899944

945+
@cached_property
946+
def browser(self) -> browser.AsyncBrowserResourceWithStreamingResponse:
947+
from .resources.browser import AsyncBrowserResourceWithStreamingResponse
948+
949+
return AsyncBrowserResourceWithStreamingResponse(self._client.browser)
950+
900951
@cached_property
901952
def feedback(self) -> feedback.AsyncFeedbackResourceWithStreamingResponse:
902953
"""Report API issues and documentation mismatches."""

‎src/context/dev/resources/__init__.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656
PeopleResourceWithStreamingResponse,
5757
AsyncPeopleResourceWithStreamingResponse,
5858
)
59+
from .browser import (
60+
BrowserResource,
61+
AsyncBrowserResource,
62+
BrowserResourceWithRawResponse,
63+
AsyncBrowserResourceWithRawResponse,
64+
BrowserResourceWithStreamingResponse,
65+
AsyncBrowserResourceWithStreamingResponse,
66+
)
5967
from .utility import (
6068
UtilityResource,
6169
AsyncUtilityResource,
@@ -164,6 +172,12 @@
164172
"AsyncLogsResourceWithRawResponse",
165173
"LogsResourceWithStreamingResponse",
166174
"AsyncLogsResourceWithStreamingResponse",
175+
"BrowserResource",
176+
"AsyncBrowserResource",
177+
"BrowserResourceWithRawResponse",
178+
"AsyncBrowserResourceWithRawResponse",
179+
"BrowserResourceWithStreamingResponse",
180+
"AsyncBrowserResourceWithStreamingResponse",
167181
"FeedbackResource",
168182
"AsyncFeedbackResource",
169183
"FeedbackResourceWithRawResponse",
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .browser import (
4+
BrowserResource,
5+
AsyncBrowserResource,
6+
BrowserResourceWithRawResponse,
7+
AsyncBrowserResourceWithRawResponse,
8+
BrowserResourceWithStreamingResponse,
9+
AsyncBrowserResourceWithStreamingResponse,
10+
)
11+
from .profiles import (
12+
ProfilesResource,
13+
AsyncProfilesResource,
14+
ProfilesResourceWithRawResponse,
15+
AsyncProfilesResourceWithRawResponse,
16+
ProfilesResourceWithStreamingResponse,
17+
AsyncProfilesResourceWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"ProfilesResource",
22+
"AsyncProfilesResource",
23+
"ProfilesResourceWithRawResponse",
24+
"AsyncProfilesResourceWithRawResponse",
25+
"ProfilesResourceWithStreamingResponse",
26+
"AsyncProfilesResourceWithStreamingResponse",
27+
"BrowserResource",
28+
"AsyncBrowserResource",
29+
"BrowserResourceWithRawResponse",
30+
"AsyncBrowserResourceWithRawResponse",
31+
"BrowserResourceWithStreamingResponse",
32+
"AsyncBrowserResourceWithStreamingResponse",
33+
]
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from .profiles import (
6+
ProfilesResource,
7+
AsyncProfilesResource,
8+
ProfilesResourceWithRawResponse,
9+
AsyncProfilesResourceWithRawResponse,
10+
ProfilesResourceWithStreamingResponse,
11+
AsyncProfilesResourceWithStreamingResponse,
12+
)
13+
from ..._compat import cached_property
14+
from ..._resource import SyncAPIResource, AsyncAPIResource
15+
16+
__all__ = ["BrowserResource", "AsyncBrowserResource"]
17+
18+
19+
class BrowserResource(SyncAPIResource):
20+
@cached_property
21+
def profiles(self) -> ProfilesResource:
22+
"""See the authenticated browser profiles your organization created."""
23+
return ProfilesResource(self._client)
24+
25+
@cached_property
26+
def with_raw_response(self) -> BrowserResourceWithRawResponse:
27+
"""
28+
This property can be used as a prefix for any HTTP method call to return
29+
the raw response object instead of the parsed content.
30+
31+
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
32+
"""
33+
return BrowserResourceWithRawResponse(self)
34+
35+
@cached_property
36+
def with_streaming_response(self) -> BrowserResourceWithStreamingResponse:
37+
"""
38+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
39+
40+
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
41+
"""
42+
return BrowserResourceWithStreamingResponse(self)
43+
44+
45+
class AsyncBrowserResource(AsyncAPIResource):
46+
@cached_property
47+
def profiles(self) -> AsyncProfilesResource:
48+
"""See the authenticated browser profiles your organization created."""
49+
return AsyncProfilesResource(self._client)
50+
51+
@cached_property
52+
def with_raw_response(self) -> AsyncBrowserResourceWithRawResponse:
53+
"""
54+
This property can be used as a prefix for any HTTP method call to return
55+
the raw response object instead of the parsed content.
56+
57+
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
58+
"""
59+
return AsyncBrowserResourceWithRawResponse(self)
60+
61+
@cached_property
62+
def with_streaming_response(self) -> AsyncBrowserResourceWithStreamingResponse:
63+
"""
64+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
65+
66+
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
67+
"""
68+
return AsyncBrowserResourceWithStreamingResponse(self)
69+
70+
71+
class BrowserResourceWithRawResponse:
72+
def __init__(self, browser: BrowserResource) -> None:
73+
self._browser = browser
74+
75+
@cached_property
76+
def profiles(self) -> ProfilesResourceWithRawResponse:
77+
"""See the authenticated browser profiles your organization created."""
78+
return ProfilesResourceWithRawResponse(self._browser.profiles)
79+
80+
81+
class AsyncBrowserResourceWithRawResponse:
82+
def __init__(self, browser: AsyncBrowserResource) -> None:
83+
self._browser = browser
84+
85+
@cached_property
86+
def profiles(self) -> AsyncProfilesResourceWithRawResponse:
87+
"""See the authenticated browser profiles your organization created."""
88+
return AsyncProfilesResourceWithRawResponse(self._browser.profiles)
89+
90+
91+
class BrowserResourceWithStreamingResponse:
92+
def __init__(self, browser: BrowserResource) -> None:
93+
self._browser = browser
94+
95+
@cached_property
96+
def profiles(self) -> ProfilesResourceWithStreamingResponse:
97+
"""See the authenticated browser profiles your organization created."""
98+
return ProfilesResourceWithStreamingResponse(self._browser.profiles)
99+
100+
101+
class AsyncBrowserResourceWithStreamingResponse:
102+
def __init__(self, browser: AsyncBrowserResource) -> None:
103+
self._browser = browser
104+
105+
@cached_property
106+
def profiles(self) -> AsyncProfilesResourceWithStreamingResponse:
107+
"""See the authenticated browser profiles your organization created."""
108+
return AsyncProfilesResourceWithStreamingResponse(self._browser.profiles)

0 commit comments

Comments
 (0)