Skip to content

Commit 4f84467

Browse files
feat(api): manual updates
1 parent 253db7d commit 4f84467

9 files changed

Lines changed: 828 additions & 4 deletions

File tree

‎.stats.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 40
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-4f279e7b1f0a52f5c917d4256e17188dfe330ddf7495146e2b1611e812605fdc.yml
1+
configured_endpoints: 41
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-5dbe631ce516ca688273053ddcb58870561bd6dc76fa75df354c954d7af65a3c.yml
33
openapi_spec_hash: 53a74c4cccbdec8590db38183840a446
4-
config_hash: 920678668dd2da6f8966fbf1b8fde4e2
4+
config_hash: 0fb0ceca5946298c416cec0cca5260c7

‎api.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,15 @@ from context.dev.types import PersonEnrichResponse
178178
Methods:
179179

180180
- <code title="post /people/enrich">client.people.<a href="./src/context/dev/resources/people.py">enrich</a>(\*\*<a href="src/context/dev/types/person_enrich_params.py">params</a>) -> <a href="./src/context/dev/types/person_enrich_response.py">PersonEnrichResponse</a></code>
181+
182+
# News
183+
184+
Types:
185+
186+
```python
187+
from context.dev.types import NewsSearchResponse
188+
```
189+
190+
Methods:
191+
192+
- <code title="post /news/search">client.news.<a href="./src/context/dev/resources/news.py">search</a>(\*\*<a href="src/context/dev/types/news_search_params.py">params</a>) -> <a href="./src/context/dev/types/news_search_response.py">NewsSearchResponse</a></code>

‎src/context/dev/_client.py‎

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@
3535
)
3636

3737
if TYPE_CHECKING:
38-
from .resources import ai, web, batch, brand, parse, people, utility, industry, monitors
38+
from .resources import ai, web, news, batch, brand, parse, people, utility, industry, monitors
3939
from .resources.ai import AIResource, AsyncAIResource
4040
from .resources.web import WebResource, AsyncWebResource
41+
from .resources.news import NewsResource, AsyncNewsResource
4142
from .resources.batch import BatchResource, AsyncBatchResource
4243
from .resources.brand import BrandResource, AsyncBrandResource
4344
from .resources.parse import ParseResource, AsyncParseResource
@@ -180,6 +181,13 @@ def people(self) -> PeopleResource:
180181

181182
return PeopleResource(self)
182183

184+
@cached_property
185+
def news(self) -> NewsResource:
186+
"""Search live first-party RSS and free historical news data by company identity."""
187+
from .resources.news import NewsResource
188+
189+
return NewsResource(self)
190+
183191
@cached_property
184192
def with_raw_response(self) -> ContextDevWithRawResponse:
185193
return ContextDevWithRawResponse(self)
@@ -415,6 +423,13 @@ def people(self) -> AsyncPeopleResource:
415423

416424
return AsyncPeopleResource(self)
417425

426+
@cached_property
427+
def news(self) -> AsyncNewsResource:
428+
"""Search live first-party RSS and free historical news data by company identity."""
429+
from .resources.news import AsyncNewsResource
430+
431+
return AsyncNewsResource(self)
432+
418433
@cached_property
419434
def with_raw_response(self) -> AsyncContextDevWithRawResponse:
420435
return AsyncContextDevWithRawResponse(self)
@@ -592,6 +607,13 @@ def people(self) -> people.PeopleResourceWithRawResponse:
592607

593608
return PeopleResourceWithRawResponse(self._client.people)
594609

610+
@cached_property
611+
def news(self) -> news.NewsResourceWithRawResponse:
612+
"""Search live first-party RSS and free historical news data by company identity."""
613+
from .resources.news import NewsResourceWithRawResponse
614+
615+
return NewsResourceWithRawResponse(self._client.news)
616+
595617

596618
class AsyncContextDevWithRawResponse:
597619
_client: AsyncContextDev
@@ -657,6 +679,13 @@ def people(self) -> people.AsyncPeopleResourceWithRawResponse:
657679

658680
return AsyncPeopleResourceWithRawResponse(self._client.people)
659681

682+
@cached_property
683+
def news(self) -> news.AsyncNewsResourceWithRawResponse:
684+
"""Search live first-party RSS and free historical news data by company identity."""
685+
from .resources.news import AsyncNewsResourceWithRawResponse
686+
687+
return AsyncNewsResourceWithRawResponse(self._client.news)
688+
660689

661690
class ContextDevWithStreamedResponse:
662691
_client: ContextDev
@@ -722,6 +751,13 @@ def people(self) -> people.PeopleResourceWithStreamingResponse:
722751

723752
return PeopleResourceWithStreamingResponse(self._client.people)
724753

754+
@cached_property
755+
def news(self) -> news.NewsResourceWithStreamingResponse:
756+
"""Search live first-party RSS and free historical news data by company identity."""
757+
from .resources.news import NewsResourceWithStreamingResponse
758+
759+
return NewsResourceWithStreamingResponse(self._client.news)
760+
725761

726762
class AsyncContextDevWithStreamedResponse:
727763
_client: AsyncContextDev
@@ -787,6 +823,13 @@ def people(self) -> people.AsyncPeopleResourceWithStreamingResponse:
787823

788824
return AsyncPeopleResourceWithStreamingResponse(self._client.people)
789825

826+
@cached_property
827+
def news(self) -> news.AsyncNewsResourceWithStreamingResponse:
828+
"""Search live first-party RSS and free historical news data by company identity."""
829+
from .resources.news import AsyncNewsResourceWithStreamingResponse
830+
831+
return AsyncNewsResourceWithStreamingResponse(self._client.news)
832+
790833

791834
Client = ContextDev
792835

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
WebResourceWithStreamingResponse,
1717
AsyncWebResourceWithStreamingResponse,
1818
)
19+
from .news import (
20+
NewsResource,
21+
AsyncNewsResource,
22+
NewsResourceWithRawResponse,
23+
AsyncNewsResourceWithRawResponse,
24+
NewsResourceWithStreamingResponse,
25+
AsyncNewsResourceWithStreamingResponse,
26+
)
1927
from .batch import (
2028
BatchResource,
2129
AsyncBatchResource,
@@ -128,4 +136,10 @@
128136
"AsyncPeopleResourceWithRawResponse",
129137
"PeopleResourceWithStreamingResponse",
130138
"AsyncPeopleResourceWithStreamingResponse",
139+
"NewsResource",
140+
"AsyncNewsResource",
141+
"NewsResourceWithRawResponse",
142+
"AsyncNewsResourceWithRawResponse",
143+
"NewsResourceWithStreamingResponse",
144+
"AsyncNewsResourceWithStreamingResponse",
131145
]

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

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Optional
6+
7+
import httpx
8+
9+
from ..types import news_search_params
10+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
11+
from .._utils import maybe_transform, async_maybe_transform
12+
from .._compat import cached_property
13+
from .._resource import SyncAPIResource, AsyncAPIResource
14+
from .._response import (
15+
to_raw_response_wrapper,
16+
to_streamed_response_wrapper,
17+
async_to_raw_response_wrapper,
18+
async_to_streamed_response_wrapper,
19+
)
20+
from .._base_client import make_request_options
21+
from ..types.news_search_response import NewsSearchResponse
22+
23+
__all__ = ["NewsResource", "AsyncNewsResource"]
24+
25+
26+
class NewsResource(SyncAPIResource):
27+
"""Search live first-party RSS and free historical news data by company identity."""
28+
29+
@cached_property
30+
def with_raw_response(self) -> NewsResourceWithRawResponse:
31+
"""
32+
This property can be used as a prefix for any HTTP method call to return
33+
the raw response object instead of the parsed content.
34+
35+
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
36+
"""
37+
return NewsResourceWithRawResponse(self)
38+
39+
@cached_property
40+
def with_streaming_response(self) -> NewsResourceWithStreamingResponse:
41+
"""
42+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
43+
44+
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
45+
"""
46+
return NewsResourceWithStreamingResponse(self)
47+
48+
def search(
49+
self,
50+
*,
51+
search_by: news_search_params.SearchBy,
52+
cursor: Optional[str] | Omit = omit,
53+
filter_by: news_search_params.FilterBy | Omit = omit,
54+
limit: int | Omit = omit,
55+
sort_by: news_search_params.SortBy | Omit = omit,
56+
tags: SequenceNotStr[str] | Omit = omit,
57+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
58+
# The extra values given here take precedence over values defined on the client or passed to this method.
59+
extra_headers: Headers | None = None,
60+
extra_query: Query | None = None,
61+
extra_body: Body | None = None,
62+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
63+
) -> NewsSearchResponse:
64+
"""
65+
Searches live and historical company news for one company, identified in
66+
searchBy by name, domain, ticker (optionally disambiguated by exchange), or
67+
ISIN. Results can be filtered by publisher domain, publisher country, article
68+
language, article type, and published-at date, and include stable story IDs,
69+
source metadata, verified entity relevance, and cursor pagination.
70+
71+
Args:
72+
search_by: What to search for.
73+
74+
cursor: Opaque next_cursor from the previous response, or null for the first page.
75+
76+
filter_by: Optional result filters.
77+
78+
limit: Maximum results to return. Defaults to 10.
79+
80+
sort_by: Result ordering. Defaults to newest.
81+
82+
tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
83+
84+
extra_headers: Send extra headers
85+
86+
extra_query: Add additional query parameters to the request
87+
88+
extra_body: Add additional JSON properties to the request
89+
90+
timeout: Override the client-level default timeout for this request, in seconds
91+
"""
92+
return self._post(
93+
"/news/search",
94+
body=maybe_transform(
95+
{
96+
"search_by": search_by,
97+
"cursor": cursor,
98+
"filter_by": filter_by,
99+
"limit": limit,
100+
"sort_by": sort_by,
101+
"tags": tags,
102+
},
103+
news_search_params.NewsSearchParams,
104+
),
105+
options=make_request_options(
106+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
107+
),
108+
cast_to=NewsSearchResponse,
109+
)
110+
111+
112+
class AsyncNewsResource(AsyncAPIResource):
113+
"""Search live first-party RSS and free historical news data by company identity."""
114+
115+
@cached_property
116+
def with_raw_response(self) -> AsyncNewsResourceWithRawResponse:
117+
"""
118+
This property can be used as a prefix for any HTTP method call to return
119+
the raw response object instead of the parsed content.
120+
121+
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
122+
"""
123+
return AsyncNewsResourceWithRawResponse(self)
124+
125+
@cached_property
126+
def with_streaming_response(self) -> AsyncNewsResourceWithStreamingResponse:
127+
"""
128+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
129+
130+
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
131+
"""
132+
return AsyncNewsResourceWithStreamingResponse(self)
133+
134+
async def search(
135+
self,
136+
*,
137+
search_by: news_search_params.SearchBy,
138+
cursor: Optional[str] | Omit = omit,
139+
filter_by: news_search_params.FilterBy | Omit = omit,
140+
limit: int | Omit = omit,
141+
sort_by: news_search_params.SortBy | Omit = omit,
142+
tags: SequenceNotStr[str] | Omit = omit,
143+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
144+
# The extra values given here take precedence over values defined on the client or passed to this method.
145+
extra_headers: Headers | None = None,
146+
extra_query: Query | None = None,
147+
extra_body: Body | None = None,
148+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
149+
) -> NewsSearchResponse:
150+
"""
151+
Searches live and historical company news for one company, identified in
152+
searchBy by name, domain, ticker (optionally disambiguated by exchange), or
153+
ISIN. Results can be filtered by publisher domain, publisher country, article
154+
language, article type, and published-at date, and include stable story IDs,
155+
source metadata, verified entity relevance, and cursor pagination.
156+
157+
Args:
158+
search_by: What to search for.
159+
160+
cursor: Opaque next_cursor from the previous response, or null for the first page.
161+
162+
filter_by: Optional result filters.
163+
164+
limit: Maximum results to return. Defaults to 10.
165+
166+
sort_by: Result ordering. Defaults to newest.
167+
168+
tags: Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
169+
170+
extra_headers: Send extra headers
171+
172+
extra_query: Add additional query parameters to the request
173+
174+
extra_body: Add additional JSON properties to the request
175+
176+
timeout: Override the client-level default timeout for this request, in seconds
177+
"""
178+
return await self._post(
179+
"/news/search",
180+
body=await async_maybe_transform(
181+
{
182+
"search_by": search_by,
183+
"cursor": cursor,
184+
"filter_by": filter_by,
185+
"limit": limit,
186+
"sort_by": sort_by,
187+
"tags": tags,
188+
},
189+
news_search_params.NewsSearchParams,
190+
),
191+
options=make_request_options(
192+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
193+
),
194+
cast_to=NewsSearchResponse,
195+
)
196+
197+
198+
class NewsResourceWithRawResponse:
199+
def __init__(self, news: NewsResource) -> None:
200+
self._news = news
201+
202+
self.search = to_raw_response_wrapper(
203+
news.search,
204+
)
205+
206+
207+
class AsyncNewsResourceWithRawResponse:
208+
def __init__(self, news: AsyncNewsResource) -> None:
209+
self._news = news
210+
211+
self.search = async_to_raw_response_wrapper(
212+
news.search,
213+
)
214+
215+
216+
class NewsResourceWithStreamingResponse:
217+
def __init__(self, news: NewsResource) -> None:
218+
self._news = news
219+
220+
self.search = to_streamed_response_wrapper(
221+
news.search,
222+
)
223+
224+
225+
class AsyncNewsResourceWithStreamingResponse:
226+
def __init__(self, news: AsyncNewsResource) -> None:
227+
self._news = news
228+
229+
self.search = async_to_streamed_response_wrapper(
230+
news.search,
231+
)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .webhook_delivery import WebhookDelivery as WebhookDelivery
1010
from .batch_list_params import BatchListParams as BatchListParams
1111
from .web_search_params import WebSearchParams as WebSearchParams
12+
from .news_search_params import NewsSearchParams as NewsSearchParams
1213
from .web_extract_params import WebExtractParams as WebExtractParams
1314
from .batch_list_response import BatchListResponse as BatchListResponse
1415
from .batch_submit_params import BatchSubmitParams as BatchSubmitParams
@@ -17,6 +18,7 @@
1718
from .parse_handle_params import ParseHandleParams as ParseHandleParams
1819
from .web_search_response import WebSearchResponse as WebSearchResponse
1920
from .monitor_run_response import MonitorRunResponse as MonitorRunResponse
21+
from .news_search_response import NewsSearchResponse as NewsSearchResponse
2022
from .person_enrich_params import PersonEnrichParams as PersonEnrichParams
2123
from .web_extract_response import WebExtractResponse as WebExtractResponse
2224
from .batch_cancel_response import BatchCancelResponse as BatchCancelResponse

0 commit comments

Comments
 (0)