Skip to content

Commit 2af78a4

Browse files
feat(api): manual updates
1 parent 512bf26 commit 2af78a4

9 files changed

Lines changed: 466 additions & 3 deletions

File tree

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 20
1+
configured_endpoints: 21
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev%2Fcontext.dev-7e43493a842618882d9d7d4f33c51d4b6a1e99c960f8be0996bd544864a5e79f.yml
33
openapi_spec_hash: 44bc5177ca909b32a1617ce637f5d704
4-
config_hash: 85e90b8fda2e1f326ca60f8ab3e53704
4+
config_hash: 7d13dca2b2c6f71fc463cb6062efa5ea

‎api.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ Methods:
6666
- <code title="get /brand/retrieve-by-ticker">client.brand.<a href="./src/context/dev/resources/brand.py">retrieve_by_ticker</a>(\*\*<a href="src/context/dev/types/brand_retrieve_by_ticker_params.py">params</a>) -> <a href="./src/context/dev/types/brand_retrieve_by_ticker_response.py">BrandRetrieveByTickerResponse</a></code>
6767
- <code title="get /brand/retrieve-simplified">client.brand.<a href="./src/context/dev/resources/brand.py">retrieve_simplified</a>(\*\*<a href="src/context/dev/types/brand_retrieve_simplified_params.py">params</a>) -> <a href="./src/context/dev/types/brand_retrieve_simplified_response.py">BrandRetrieveSimplifiedResponse</a></code>
6868

69+
# Industry
70+
71+
Types:
72+
73+
```python
74+
from context.dev.types import IndustryRetrieveNaicsResponse
75+
```
76+
77+
Methods:
78+
79+
- <code title="get /web/naics">client.industry.<a href="./src/context/dev/resources/industry.py">retrieve_naics</a>(\*\*<a href="src/context/dev/types/industry_retrieve_naics_params.py">params</a>) -> <a href="./src/context/dev/types/industry_retrieve_naics_response.py">IndustryRetrieveNaicsResponse</a></code>
80+
6981
# Utility
7082

7183
Types:

‎src/context/dev/_client.py‎

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@
3131
)
3232

3333
if TYPE_CHECKING:
34-
from .resources import ai, web, brand, utility
34+
from .resources import ai, web, brand, utility, industry
3535
from .resources.ai import AIResource, AsyncAIResource
3636
from .resources.web import WebResource, AsyncWebResource
3737
from .resources.brand import BrandResource, AsyncBrandResource
3838
from .resources.utility import UtilityResource, AsyncUtilityResource
39+
from .resources.industry import IndustryResource, AsyncIndustryResource
3940

4041
__all__ = [
4142
"Timeout",
@@ -122,6 +123,12 @@ def brand(self) -> BrandResource:
122123

123124
return BrandResource(self)
124125

126+
@cached_property
127+
def industry(self) -> IndustryResource:
128+
from .resources.industry import IndustryResource
129+
130+
return IndustryResource(self)
131+
125132
@cached_property
126133
def utility(self) -> UtilityResource:
127134
from .resources.utility import UtilityResource
@@ -314,6 +321,12 @@ def brand(self) -> AsyncBrandResource:
314321

315322
return AsyncBrandResource(self)
316323

324+
@cached_property
325+
def industry(self) -> AsyncIndustryResource:
326+
from .resources.industry import AsyncIndustryResource
327+
328+
return AsyncIndustryResource(self)
329+
317330
@cached_property
318331
def utility(self) -> AsyncUtilityResource:
319332
from .resources.utility import AsyncUtilityResource
@@ -457,6 +470,12 @@ def brand(self) -> brand.BrandResourceWithRawResponse:
457470

458471
return BrandResourceWithRawResponse(self._client.brand)
459472

473+
@cached_property
474+
def industry(self) -> industry.IndustryResourceWithRawResponse:
475+
from .resources.industry import IndustryResourceWithRawResponse
476+
477+
return IndustryResourceWithRawResponse(self._client.industry)
478+
460479
@cached_property
461480
def utility(self) -> utility.UtilityResourceWithRawResponse:
462481
from .resources.utility import UtilityResourceWithRawResponse
@@ -488,6 +507,12 @@ def brand(self) -> brand.AsyncBrandResourceWithRawResponse:
488507

489508
return AsyncBrandResourceWithRawResponse(self._client.brand)
490509

510+
@cached_property
511+
def industry(self) -> industry.AsyncIndustryResourceWithRawResponse:
512+
from .resources.industry import AsyncIndustryResourceWithRawResponse
513+
514+
return AsyncIndustryResourceWithRawResponse(self._client.industry)
515+
491516
@cached_property
492517
def utility(self) -> utility.AsyncUtilityResourceWithRawResponse:
493518
from .resources.utility import AsyncUtilityResourceWithRawResponse
@@ -519,6 +544,12 @@ def brand(self) -> brand.BrandResourceWithStreamingResponse:
519544

520545
return BrandResourceWithStreamingResponse(self._client.brand)
521546

547+
@cached_property
548+
def industry(self) -> industry.IndustryResourceWithStreamingResponse:
549+
from .resources.industry import IndustryResourceWithStreamingResponse
550+
551+
return IndustryResourceWithStreamingResponse(self._client.industry)
552+
522553
@cached_property
523554
def utility(self) -> utility.UtilityResourceWithStreamingResponse:
524555
from .resources.utility import UtilityResourceWithStreamingResponse
@@ -550,6 +581,12 @@ def brand(self) -> brand.AsyncBrandResourceWithStreamingResponse:
550581

551582
return AsyncBrandResourceWithStreamingResponse(self._client.brand)
552583

584+
@cached_property
585+
def industry(self) -> industry.AsyncIndustryResourceWithStreamingResponse:
586+
from .resources.industry import AsyncIndustryResourceWithStreamingResponse
587+
588+
return AsyncIndustryResourceWithStreamingResponse(self._client.industry)
589+
553590
@cached_property
554591
def utility(self) -> utility.AsyncUtilityResourceWithStreamingResponse:
555592
from .resources.utility import AsyncUtilityResourceWithStreamingResponse

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@
3232
UtilityResourceWithStreamingResponse,
3333
AsyncUtilityResourceWithStreamingResponse,
3434
)
35+
from .industry import (
36+
IndustryResource,
37+
AsyncIndustryResource,
38+
IndustryResourceWithRawResponse,
39+
AsyncIndustryResourceWithRawResponse,
40+
IndustryResourceWithStreamingResponse,
41+
AsyncIndustryResourceWithStreamingResponse,
42+
)
3543

3644
__all__ = [
3745
"WebResource",
@@ -52,6 +60,12 @@
5260
"AsyncBrandResourceWithRawResponse",
5361
"BrandResourceWithStreamingResponse",
5462
"AsyncBrandResourceWithStreamingResponse",
63+
"IndustryResource",
64+
"AsyncIndustryResource",
65+
"IndustryResourceWithRawResponse",
66+
"AsyncIndustryResourceWithRawResponse",
67+
"IndustryResourceWithStreamingResponse",
68+
"AsyncIndustryResourceWithStreamingResponse",
5569
"UtilityResource",
5670
"AsyncUtilityResource",
5771
"UtilityResourceWithRawResponse",
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
import httpx
6+
7+
from ..types import industry_retrieve_naics_params
8+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
9+
from .._utils import maybe_transform, async_maybe_transform
10+
from .._compat import cached_property
11+
from .._resource import SyncAPIResource, AsyncAPIResource
12+
from .._response import (
13+
to_raw_response_wrapper,
14+
to_streamed_response_wrapper,
15+
async_to_raw_response_wrapper,
16+
async_to_streamed_response_wrapper,
17+
)
18+
from .._base_client import make_request_options
19+
from ..types.industry_retrieve_naics_response import IndustryRetrieveNaicsResponse
20+
21+
__all__ = ["IndustryResource", "AsyncIndustryResource"]
22+
23+
24+
class IndustryResource(SyncAPIResource):
25+
@cached_property
26+
def with_raw_response(self) -> IndustryResourceWithRawResponse:
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 IndustryResourceWithRawResponse(self)
34+
35+
@cached_property
36+
def with_streaming_response(self) -> IndustryResourceWithStreamingResponse:
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 IndustryResourceWithStreamingResponse(self)
43+
44+
def retrieve_naics(
45+
self,
46+
*,
47+
input: str,
48+
max_results: int | Omit = omit,
49+
min_results: int | Omit = omit,
50+
timeout_ms: int | Omit = omit,
51+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
52+
# The extra values given here take precedence over values defined on the client or passed to this method.
53+
extra_headers: Headers | None = None,
54+
extra_query: Query | None = None,
55+
extra_body: Body | None = None,
56+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
57+
) -> IndustryRetrieveNaicsResponse:
58+
"""
59+
Classify any brand into 2022 NAICS industry codes from its domain or name.
60+
61+
Args:
62+
input: Brand domain or title to retrieve NAICS code for. If a valid domain is provided,
63+
it will be used for classification, otherwise, we will search for the brand
64+
using the provided title.
65+
66+
max_results: Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults
67+
to 5.
68+
69+
min_results: Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
70+
71+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
72+
than this value, it will be aborted with a 408 status code. Maximum allowed
73+
value is 300000ms (5 minutes).
74+
75+
extra_headers: Send extra headers
76+
77+
extra_query: Add additional query parameters to the request
78+
79+
extra_body: Add additional JSON properties to the request
80+
81+
timeout: Override the client-level default timeout for this request, in seconds
82+
"""
83+
return self._get(
84+
"/web/naics",
85+
options=make_request_options(
86+
extra_headers=extra_headers,
87+
extra_query=extra_query,
88+
extra_body=extra_body,
89+
timeout=timeout,
90+
query=maybe_transform(
91+
{
92+
"input": input,
93+
"max_results": max_results,
94+
"min_results": min_results,
95+
"timeout_ms": timeout_ms,
96+
},
97+
industry_retrieve_naics_params.IndustryRetrieveNaicsParams,
98+
),
99+
),
100+
cast_to=IndustryRetrieveNaicsResponse,
101+
)
102+
103+
104+
class AsyncIndustryResource(AsyncAPIResource):
105+
@cached_property
106+
def with_raw_response(self) -> AsyncIndustryResourceWithRawResponse:
107+
"""
108+
This property can be used as a prefix for any HTTP method call to return
109+
the raw response object instead of the parsed content.
110+
111+
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#accessing-raw-response-data-eg-headers
112+
"""
113+
return AsyncIndustryResourceWithRawResponse(self)
114+
115+
@cached_property
116+
def with_streaming_response(self) -> AsyncIndustryResourceWithStreamingResponse:
117+
"""
118+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
119+
120+
For more information, see https://www.github.com/context-dot-dev/context-python-sdk#with_streaming_response
121+
"""
122+
return AsyncIndustryResourceWithStreamingResponse(self)
123+
124+
async def retrieve_naics(
125+
self,
126+
*,
127+
input: str,
128+
max_results: int | Omit = omit,
129+
min_results: int | Omit = omit,
130+
timeout_ms: int | Omit = omit,
131+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
132+
# The extra values given here take precedence over values defined on the client or passed to this method.
133+
extra_headers: Headers | None = None,
134+
extra_query: Query | None = None,
135+
extra_body: Body | None = None,
136+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
137+
) -> IndustryRetrieveNaicsResponse:
138+
"""
139+
Classify any brand into 2022 NAICS industry codes from its domain or name.
140+
141+
Args:
142+
input: Brand domain or title to retrieve NAICS code for. If a valid domain is provided,
143+
it will be used for classification, otherwise, we will search for the brand
144+
using the provided title.
145+
146+
max_results: Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults
147+
to 5.
148+
149+
min_results: Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
150+
151+
timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
152+
than this value, it will be aborted with a 408 status code. Maximum allowed
153+
value is 300000ms (5 minutes).
154+
155+
extra_headers: Send extra headers
156+
157+
extra_query: Add additional query parameters to the request
158+
159+
extra_body: Add additional JSON properties to the request
160+
161+
timeout: Override the client-level default timeout for this request, in seconds
162+
"""
163+
return await self._get(
164+
"/web/naics",
165+
options=make_request_options(
166+
extra_headers=extra_headers,
167+
extra_query=extra_query,
168+
extra_body=extra_body,
169+
timeout=timeout,
170+
query=await async_maybe_transform(
171+
{
172+
"input": input,
173+
"max_results": max_results,
174+
"min_results": min_results,
175+
"timeout_ms": timeout_ms,
176+
},
177+
industry_retrieve_naics_params.IndustryRetrieveNaicsParams,
178+
),
179+
),
180+
cast_to=IndustryRetrieveNaicsResponse,
181+
)
182+
183+
184+
class IndustryResourceWithRawResponse:
185+
def __init__(self, industry: IndustryResource) -> None:
186+
self._industry = industry
187+
188+
self.retrieve_naics = to_raw_response_wrapper(
189+
industry.retrieve_naics,
190+
)
191+
192+
193+
class AsyncIndustryResourceWithRawResponse:
194+
def __init__(self, industry: AsyncIndustryResource) -> None:
195+
self._industry = industry
196+
197+
self.retrieve_naics = async_to_raw_response_wrapper(
198+
industry.retrieve_naics,
199+
)
200+
201+
202+
class IndustryResourceWithStreamingResponse:
203+
def __init__(self, industry: IndustryResource) -> None:
204+
self._industry = industry
205+
206+
self.retrieve_naics = to_streamed_response_wrapper(
207+
industry.retrieve_naics,
208+
)
209+
210+
211+
class AsyncIndustryResourceWithStreamingResponse:
212+
def __init__(self, industry: AsyncIndustryResource) -> None:
213+
self._industry = industry
214+
215+
self.retrieve_naics = async_to_streamed_response_wrapper(
216+
industry.retrieve_naics,
217+
)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from .web_extract_styleguide_params import WebExtractStyleguideParams as WebExtractStyleguideParams
2929
from .web_web_scrape_sitemap_params import WebWebScrapeSitemapParams as WebWebScrapeSitemapParams
3030
from .brand_retrieve_by_email_params import BrandRetrieveByEmailParams as BrandRetrieveByEmailParams
31+
from .industry_retrieve_naics_params import IndustryRetrieveNaicsParams as IndustryRetrieveNaicsParams
3132
from .web_web_scrape_images_response import WebWebScrapeImagesResponse as WebWebScrapeImagesResponse
3233
from .brand_retrieve_by_isin_response import BrandRetrieveByIsinResponse as BrandRetrieveByIsinResponse
3334
from .brand_retrieve_by_name_response import BrandRetrieveByNameResponse as BrandRetrieveByNameResponse
@@ -36,6 +37,7 @@
3637
from .web_web_scrape_sitemap_response import WebWebScrapeSitemapResponse as WebWebScrapeSitemapResponse
3738
from .brand_retrieve_by_email_response import BrandRetrieveByEmailResponse as BrandRetrieveByEmailResponse
3839
from .brand_retrieve_simplified_params import BrandRetrieveSimplifiedParams as BrandRetrieveSimplifiedParams
40+
from .industry_retrieve_naics_response import IndustryRetrieveNaicsResponse as IndustryRetrieveNaicsResponse
3941
from .utility_prefetch_by_email_params import UtilityPrefetchByEmailParams as UtilityPrefetchByEmailParams
4042
from .brand_retrieve_by_ticker_response import BrandRetrieveByTickerResponse as BrandRetrieveByTickerResponse
4143
from .brand_retrieve_simplified_response import BrandRetrieveSimplifiedResponse as BrandRetrieveSimplifiedResponse

0 commit comments

Comments
 (0)