22
33from __future__ import annotations
44
5+ from typing_extensions import Literal
6+
57import httpx
68
7- from ..types import industry_retrieve_naics_params
9+ from ..types import industry_retrieve_sic_params , industry_retrieve_naics_params
810from .._types import Body , Omit , Query , Headers , NotGiven , omit , not_given
911from .._utils import maybe_transform , async_maybe_transform
1012from .._compat import cached_property
1618 async_to_streamed_response_wrapper ,
1719)
1820from .._base_client import make_request_options
21+ from ..types .industry_retrieve_sic_response import IndustryRetrieveSicResponse
1922from ..types .industry_retrieve_naics_response import IndustryRetrieveNaicsResponse
2023
2124__all__ = ["IndustryResource" , "AsyncIndustryResource" ]
@@ -100,6 +103,72 @@ def retrieve_naics(
100103 cast_to = IndustryRetrieveNaicsResponse ,
101104 )
102105
106+ def retrieve_sic (
107+ self ,
108+ * ,
109+ input : str ,
110+ max_results : int | Omit = omit ,
111+ min_results : int | Omit = omit ,
112+ timeout_ms : int | Omit = omit ,
113+ type : Literal ["original_sic" , "latest_sec" ] | Omit = omit ,
114+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
115+ # The extra values given here take precedence over values defined on the client or passed to this method.
116+ extra_headers : Headers | None = None ,
117+ extra_query : Query | None = None ,
118+ extra_body : Body | None = None ,
119+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
120+ ) -> IndustryRetrieveSicResponse :
121+ """
122+ Classify any brand into Standard Industrial Classification (SIC) codes from its
123+ domain or name. Choose between the original 1987 SIC system (`original_sic`) or
124+ the latest SIC list maintained by the SEC (`latest_sec`).
125+
126+ Args:
127+ input: Brand domain or title to retrieve SIC code for. If a valid domain is provided,
128+ it will be used for classification, otherwise, we will search for the brand
129+ using the provided title.
130+
131+ max_results: Maximum number of SIC codes to return. Must be between 1 and 10. Defaults to 5.
132+
133+ min_results: Minimum number of SIC codes to return. Must be at least 1. Defaults to 1.
134+
135+ timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
136+ than this value, it will be aborted with a 408 status code. Maximum allowed
137+ value is 300000ms (5 minutes).
138+
139+ type: Which SIC dataset to classify against. `original_sic` uses the 1987 Standard
140+ Industrial Classification system; `latest_sec` uses the current SIC list as
141+ published by the SEC. Defaults to `original_sic`.
142+
143+ extra_headers: Send extra headers
144+
145+ extra_query: Add additional query parameters to the request
146+
147+ extra_body: Add additional JSON properties to the request
148+
149+ timeout: Override the client-level default timeout for this request, in seconds
150+ """
151+ return self ._get (
152+ "/web/sic" ,
153+ options = make_request_options (
154+ extra_headers = extra_headers ,
155+ extra_query = extra_query ,
156+ extra_body = extra_body ,
157+ timeout = timeout ,
158+ query = maybe_transform (
159+ {
160+ "input" : input ,
161+ "max_results" : max_results ,
162+ "min_results" : min_results ,
163+ "timeout_ms" : timeout_ms ,
164+ "type" : type ,
165+ },
166+ industry_retrieve_sic_params .IndustryRetrieveSicParams ,
167+ ),
168+ ),
169+ cast_to = IndustryRetrieveSicResponse ,
170+ )
171+
103172
104173class AsyncIndustryResource (AsyncAPIResource ):
105174 @cached_property
@@ -180,6 +249,72 @@ async def retrieve_naics(
180249 cast_to = IndustryRetrieveNaicsResponse ,
181250 )
182251
252+ async def retrieve_sic (
253+ self ,
254+ * ,
255+ input : str ,
256+ max_results : int | Omit = omit ,
257+ min_results : int | Omit = omit ,
258+ timeout_ms : int | Omit = omit ,
259+ type : Literal ["original_sic" , "latest_sec" ] | Omit = omit ,
260+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
261+ # The extra values given here take precedence over values defined on the client or passed to this method.
262+ extra_headers : Headers | None = None ,
263+ extra_query : Query | None = None ,
264+ extra_body : Body | None = None ,
265+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
266+ ) -> IndustryRetrieveSicResponse :
267+ """
268+ Classify any brand into Standard Industrial Classification (SIC) codes from its
269+ domain or name. Choose between the original 1987 SIC system (`original_sic`) or
270+ the latest SIC list maintained by the SEC (`latest_sec`).
271+
272+ Args:
273+ input: Brand domain or title to retrieve SIC code for. If a valid domain is provided,
274+ it will be used for classification, otherwise, we will search for the brand
275+ using the provided title.
276+
277+ max_results: Maximum number of SIC codes to return. Must be between 1 and 10. Defaults to 5.
278+
279+ min_results: Minimum number of SIC codes to return. Must be at least 1. Defaults to 1.
280+
281+ timeout_ms: Optional timeout in milliseconds for the request. If the request takes longer
282+ than this value, it will be aborted with a 408 status code. Maximum allowed
283+ value is 300000ms (5 minutes).
284+
285+ type: Which SIC dataset to classify against. `original_sic` uses the 1987 Standard
286+ Industrial Classification system; `latest_sec` uses the current SIC list as
287+ published by the SEC. Defaults to `original_sic`.
288+
289+ extra_headers: Send extra headers
290+
291+ extra_query: Add additional query parameters to the request
292+
293+ extra_body: Add additional JSON properties to the request
294+
295+ timeout: Override the client-level default timeout for this request, in seconds
296+ """
297+ return await self ._get (
298+ "/web/sic" ,
299+ options = make_request_options (
300+ extra_headers = extra_headers ,
301+ extra_query = extra_query ,
302+ extra_body = extra_body ,
303+ timeout = timeout ,
304+ query = await async_maybe_transform (
305+ {
306+ "input" : input ,
307+ "max_results" : max_results ,
308+ "min_results" : min_results ,
309+ "timeout_ms" : timeout_ms ,
310+ "type" : type ,
311+ },
312+ industry_retrieve_sic_params .IndustryRetrieveSicParams ,
313+ ),
314+ ),
315+ cast_to = IndustryRetrieveSicResponse ,
316+ )
317+
183318
184319class IndustryResourceWithRawResponse :
185320 def __init__ (self , industry : IndustryResource ) -> None :
@@ -188,6 +323,9 @@ def __init__(self, industry: IndustryResource) -> None:
188323 self .retrieve_naics = to_raw_response_wrapper (
189324 industry .retrieve_naics ,
190325 )
326+ self .retrieve_sic = to_raw_response_wrapper (
327+ industry .retrieve_sic ,
328+ )
191329
192330
193331class AsyncIndustryResourceWithRawResponse :
@@ -197,6 +335,9 @@ def __init__(self, industry: AsyncIndustryResource) -> None:
197335 self .retrieve_naics = async_to_raw_response_wrapper (
198336 industry .retrieve_naics ,
199337 )
338+ self .retrieve_sic = async_to_raw_response_wrapper (
339+ industry .retrieve_sic ,
340+ )
200341
201342
202343class IndustryResourceWithStreamingResponse :
@@ -206,6 +347,9 @@ def __init__(self, industry: IndustryResource) -> None:
206347 self .retrieve_naics = to_streamed_response_wrapper (
207348 industry .retrieve_naics ,
208349 )
350+ self .retrieve_sic = to_streamed_response_wrapper (
351+ industry .retrieve_sic ,
352+ )
209353
210354
211355class AsyncIndustryResourceWithStreamingResponse :
@@ -215,3 +359,6 @@ def __init__(self, industry: AsyncIndustryResource) -> None:
215359 self .retrieve_naics = async_to_streamed_response_wrapper (
216360 industry .retrieve_naics ,
217361 )
362+ self .retrieve_sic = async_to_streamed_response_wrapper (
363+ industry .retrieve_sic ,
364+ )
0 commit comments