tango-python 0.0.1a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tango/__init__.py +83 -0
- tango/_base_client.py +2045 -0
- tango/_client.py +544 -0
- tango/_compat.py +219 -0
- tango/_constants.py +14 -0
- tango/_exceptions.py +108 -0
- tango/_files.py +123 -0
- tango/_models.py +788 -0
- tango/_qs.py +150 -0
- tango/_resource.py +43 -0
- tango/_response.py +824 -0
- tango/_streaming.py +333 -0
- tango/_types.py +219 -0
- tango/_utils/__init__.py +56 -0
- tango/_utils/_logs.py +25 -0
- tango/_utils/_proxy.py +62 -0
- tango/_utils/_reflection.py +42 -0
- tango/_utils/_streams.py +12 -0
- tango/_utils/_sync.py +71 -0
- tango/_utils/_transform.py +392 -0
- tango/_utils/_typing.py +120 -0
- tango/_utils/_utils.py +414 -0
- tango/_version.py +4 -0
- tango/lib/.keep +4 -0
- tango/py.typed +0 -0
- tango/resources/__init__.py +229 -0
- tango/resources/agencies.py +255 -0
- tango/resources/assistance_listings.py +214 -0
- tango/resources/bulk/__init__.py +33 -0
- tango/resources/bulk/bulk.py +102 -0
- tango/resources/bulk/entities.py +152 -0
- tango/resources/business_types.py +218 -0
- tango/resources/contracts.py +381 -0
- tango/resources/departments.py +210 -0
- tango/resources/entities.py +325 -0
- tango/resources/idvs/__init__.py +33 -0
- tango/resources/idvs/awards.py +287 -0
- tango/resources/idvs/idvs.py +413 -0
- tango/resources/naics.py +317 -0
- tango/resources/notices.py +391 -0
- tango/resources/offices.py +281 -0
- tango/resources/opportunities.py +420 -0
- tango/resources/pscs.py +210 -0
- tango/resources/schemas.py +398 -0
- tango/resources/subawards.py +313 -0
- tango/resources/versions.py +136 -0
- tango/types/__init__.py +43 -0
- tango/types/agency.py +17 -0
- tango/types/agency_list_params.py +14 -0
- tango/types/agency_list_response.py +10 -0
- tango/types/assistance_listing.py +12 -0
- tango/types/assistance_listing_list_response.py +10 -0
- tango/types/assistance_listing_retrieve_response.py +26 -0
- tango/types/bulk/__init__.py +3 -0
- tango/types/business_type.py +14 -0
- tango/types/business_type_list_response.py +10 -0
- tango/types/contract_list_params.py +78 -0
- tango/types/contract_list_response.py +55 -0
- tango/types/contract_retrieve_response.py +51 -0
- tango/types/department.py +16 -0
- tango/types/department_list_response.py +10 -0
- tango/types/entity_list_params.py +38 -0
- tango/types/entity_list_response.py +37 -0
- tango/types/entity_retrieve_response.py +116 -0
- tango/types/idv.py +102 -0
- tango/types/idv_list_params.py +78 -0
- tango/types/idv_list_response.py +27 -0
- tango/types/idvs/__init__.py +6 -0
- tango/types/idvs/award_list_params.py +55 -0
- tango/types/idvs/award_list_response.py +55 -0
- tango/types/naic_list_params.py +47 -0
- tango/types/naic_list_response.py +10 -0
- tango/types/naic_retrieve_response.py +13 -0
- tango/types/naics_code.py +13 -0
- tango/types/notice_list_params.py +81 -0
- tango/types/notice_list_response.py +60 -0
- tango/types/notice_retrieve_response.py +93 -0
- tango/types/office.py +15 -0
- tango/types/office_list_params.py +18 -0
- tango/types/office_list_response.py +18 -0
- tango/types/opportunity_list_params.py +97 -0
- tango/types/opportunity_list_response.py +101 -0
- tango/types/opportunity_retrieve_response.py +123 -0
- tango/types/product_service_code.py +21 -0
- tango/types/psc_list_response.py +10 -0
- tango/types/schema_retrieve_params.py +113 -0
- tango/types/schema_retrieve_response.py +8 -0
- tango/types/subaward.py +172 -0
- tango/types/subaward_list_params.py +33 -0
- tango/types/subaward_list_response.py +18 -0
- tango_python-0.0.1a1.dist-info/METADATA +359 -0
- tango_python-0.0.1a1.dist-info/RECORD +94 -0
- tango_python-0.0.1a1.dist-info/WHEEL +4 -0
- tango_python-0.0.1a1.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,325 @@
|
|
|
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 entity_list_params
|
|
8
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
9
|
+
from .._utils import (
|
|
10
|
+
maybe_transform,
|
|
11
|
+
async_maybe_transform,
|
|
12
|
+
)
|
|
13
|
+
from .._compat import cached_property
|
|
14
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
15
|
+
from .._response import (
|
|
16
|
+
to_raw_response_wrapper,
|
|
17
|
+
to_streamed_response_wrapper,
|
|
18
|
+
async_to_raw_response_wrapper,
|
|
19
|
+
async_to_streamed_response_wrapper,
|
|
20
|
+
)
|
|
21
|
+
from .._base_client import make_request_options
|
|
22
|
+
from ..types.entity_list_response import EntityListResponse
|
|
23
|
+
from ..types.entity_retrieve_response import EntityRetrieveResponse
|
|
24
|
+
|
|
25
|
+
__all__ = ["EntitiesResource", "AsyncEntitiesResource"]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class EntitiesResource(SyncAPIResource):
|
|
29
|
+
@cached_property
|
|
30
|
+
def with_raw_response(self) -> EntitiesResourceWithRawResponse:
|
|
31
|
+
"""
|
|
32
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
33
|
+
the raw response object instead of the parsed content.
|
|
34
|
+
|
|
35
|
+
For more information, see https://www.github.com/makegov/tango-python#accessing-raw-response-data-eg-headers
|
|
36
|
+
"""
|
|
37
|
+
return EntitiesResourceWithRawResponse(self)
|
|
38
|
+
|
|
39
|
+
@cached_property
|
|
40
|
+
def with_streaming_response(self) -> EntitiesResourceWithStreamingResponse:
|
|
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/makegov/tango-python#with_streaming_response
|
|
45
|
+
"""
|
|
46
|
+
return EntitiesResourceWithStreamingResponse(self)
|
|
47
|
+
|
|
48
|
+
def retrieve(
|
|
49
|
+
self,
|
|
50
|
+
uei: str,
|
|
51
|
+
*,
|
|
52
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
53
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
54
|
+
extra_headers: Headers | None = None,
|
|
55
|
+
extra_query: Query | None = None,
|
|
56
|
+
extra_body: Body | None = None,
|
|
57
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
58
|
+
) -> EntityRetrieveResponse:
|
|
59
|
+
"""
|
|
60
|
+
API endpoint that allows entities lookup.
|
|
61
|
+
|
|
62
|
+
Args:
|
|
63
|
+
extra_headers: Send extra headers
|
|
64
|
+
|
|
65
|
+
extra_query: Add additional query parameters to the request
|
|
66
|
+
|
|
67
|
+
extra_body: Add additional JSON properties to the request
|
|
68
|
+
|
|
69
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
70
|
+
"""
|
|
71
|
+
if not uei:
|
|
72
|
+
raise ValueError(f"Expected a non-empty value for `uei` but received {uei!r}")
|
|
73
|
+
return self._get(
|
|
74
|
+
f"/api/entities/{uei}/",
|
|
75
|
+
options=make_request_options(
|
|
76
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
77
|
+
),
|
|
78
|
+
cast_to=EntityRetrieveResponse,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
def list(
|
|
82
|
+
self,
|
|
83
|
+
*,
|
|
84
|
+
cage_code: str | NotGiven = NOT_GIVEN,
|
|
85
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
86
|
+
naics: str | NotGiven = NOT_GIVEN,
|
|
87
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
88
|
+
page: int | NotGiven = NOT_GIVEN,
|
|
89
|
+
psc: str | NotGiven = NOT_GIVEN,
|
|
90
|
+
purpose_of_registration_code: str | NotGiven = NOT_GIVEN,
|
|
91
|
+
search: str | NotGiven = NOT_GIVEN,
|
|
92
|
+
socioeconomic: str | NotGiven = NOT_GIVEN,
|
|
93
|
+
state: str | NotGiven = NOT_GIVEN,
|
|
94
|
+
uei: str | NotGiven = NOT_GIVEN,
|
|
95
|
+
zip_code: str | NotGiven = NOT_GIVEN,
|
|
96
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
97
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
98
|
+
extra_headers: Headers | None = None,
|
|
99
|
+
extra_query: Query | None = None,
|
|
100
|
+
extra_body: Body | None = None,
|
|
101
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
102
|
+
) -> EntityListResponse:
|
|
103
|
+
"""
|
|
104
|
+
API endpoint that allows entities lookup.
|
|
105
|
+
|
|
106
|
+
Args:
|
|
107
|
+
cage_code: CAGE Code
|
|
108
|
+
|
|
109
|
+
limit: Number of results to return per page.
|
|
110
|
+
|
|
111
|
+
name: The company name
|
|
112
|
+
|
|
113
|
+
page: A page number within the paginated result set.
|
|
114
|
+
|
|
115
|
+
uei: Unique Entity Identifier
|
|
116
|
+
|
|
117
|
+
extra_headers: Send extra headers
|
|
118
|
+
|
|
119
|
+
extra_query: Add additional query parameters to the request
|
|
120
|
+
|
|
121
|
+
extra_body: Add additional JSON properties to the request
|
|
122
|
+
|
|
123
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
124
|
+
"""
|
|
125
|
+
return self._get(
|
|
126
|
+
"/api/entities/",
|
|
127
|
+
options=make_request_options(
|
|
128
|
+
extra_headers=extra_headers,
|
|
129
|
+
extra_query=extra_query,
|
|
130
|
+
extra_body=extra_body,
|
|
131
|
+
timeout=timeout,
|
|
132
|
+
query=maybe_transform(
|
|
133
|
+
{
|
|
134
|
+
"cage_code": cage_code,
|
|
135
|
+
"limit": limit,
|
|
136
|
+
"naics": naics,
|
|
137
|
+
"name": name,
|
|
138
|
+
"page": page,
|
|
139
|
+
"psc": psc,
|
|
140
|
+
"purpose_of_registration_code": purpose_of_registration_code,
|
|
141
|
+
"search": search,
|
|
142
|
+
"socioeconomic": socioeconomic,
|
|
143
|
+
"state": state,
|
|
144
|
+
"uei": uei,
|
|
145
|
+
"zip_code": zip_code,
|
|
146
|
+
},
|
|
147
|
+
entity_list_params.EntityListParams,
|
|
148
|
+
),
|
|
149
|
+
),
|
|
150
|
+
cast_to=EntityListResponse,
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
class AsyncEntitiesResource(AsyncAPIResource):
|
|
155
|
+
@cached_property
|
|
156
|
+
def with_raw_response(self) -> AsyncEntitiesResourceWithRawResponse:
|
|
157
|
+
"""
|
|
158
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
159
|
+
the raw response object instead of the parsed content.
|
|
160
|
+
|
|
161
|
+
For more information, see https://www.github.com/makegov/tango-python#accessing-raw-response-data-eg-headers
|
|
162
|
+
"""
|
|
163
|
+
return AsyncEntitiesResourceWithRawResponse(self)
|
|
164
|
+
|
|
165
|
+
@cached_property
|
|
166
|
+
def with_streaming_response(self) -> AsyncEntitiesResourceWithStreamingResponse:
|
|
167
|
+
"""
|
|
168
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
169
|
+
|
|
170
|
+
For more information, see https://www.github.com/makegov/tango-python#with_streaming_response
|
|
171
|
+
"""
|
|
172
|
+
return AsyncEntitiesResourceWithStreamingResponse(self)
|
|
173
|
+
|
|
174
|
+
async def retrieve(
|
|
175
|
+
self,
|
|
176
|
+
uei: str,
|
|
177
|
+
*,
|
|
178
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
179
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
180
|
+
extra_headers: Headers | None = None,
|
|
181
|
+
extra_query: Query | None = None,
|
|
182
|
+
extra_body: Body | None = None,
|
|
183
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
184
|
+
) -> EntityRetrieveResponse:
|
|
185
|
+
"""
|
|
186
|
+
API endpoint that allows entities lookup.
|
|
187
|
+
|
|
188
|
+
Args:
|
|
189
|
+
extra_headers: Send extra headers
|
|
190
|
+
|
|
191
|
+
extra_query: Add additional query parameters to the request
|
|
192
|
+
|
|
193
|
+
extra_body: Add additional JSON properties to the request
|
|
194
|
+
|
|
195
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
196
|
+
"""
|
|
197
|
+
if not uei:
|
|
198
|
+
raise ValueError(f"Expected a non-empty value for `uei` but received {uei!r}")
|
|
199
|
+
return await self._get(
|
|
200
|
+
f"/api/entities/{uei}/",
|
|
201
|
+
options=make_request_options(
|
|
202
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
203
|
+
),
|
|
204
|
+
cast_to=EntityRetrieveResponse,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
async def list(
|
|
208
|
+
self,
|
|
209
|
+
*,
|
|
210
|
+
cage_code: str | NotGiven = NOT_GIVEN,
|
|
211
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
212
|
+
naics: str | NotGiven = NOT_GIVEN,
|
|
213
|
+
name: str | NotGiven = NOT_GIVEN,
|
|
214
|
+
page: int | NotGiven = NOT_GIVEN,
|
|
215
|
+
psc: str | NotGiven = NOT_GIVEN,
|
|
216
|
+
purpose_of_registration_code: str | NotGiven = NOT_GIVEN,
|
|
217
|
+
search: str | NotGiven = NOT_GIVEN,
|
|
218
|
+
socioeconomic: str | NotGiven = NOT_GIVEN,
|
|
219
|
+
state: str | NotGiven = NOT_GIVEN,
|
|
220
|
+
uei: str | NotGiven = NOT_GIVEN,
|
|
221
|
+
zip_code: str | NotGiven = NOT_GIVEN,
|
|
222
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
223
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
224
|
+
extra_headers: Headers | None = None,
|
|
225
|
+
extra_query: Query | None = None,
|
|
226
|
+
extra_body: Body | None = None,
|
|
227
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
228
|
+
) -> EntityListResponse:
|
|
229
|
+
"""
|
|
230
|
+
API endpoint that allows entities lookup.
|
|
231
|
+
|
|
232
|
+
Args:
|
|
233
|
+
cage_code: CAGE Code
|
|
234
|
+
|
|
235
|
+
limit: Number of results to return per page.
|
|
236
|
+
|
|
237
|
+
name: The company name
|
|
238
|
+
|
|
239
|
+
page: A page number within the paginated result set.
|
|
240
|
+
|
|
241
|
+
uei: Unique Entity Identifier
|
|
242
|
+
|
|
243
|
+
extra_headers: Send extra headers
|
|
244
|
+
|
|
245
|
+
extra_query: Add additional query parameters to the request
|
|
246
|
+
|
|
247
|
+
extra_body: Add additional JSON properties to the request
|
|
248
|
+
|
|
249
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
250
|
+
"""
|
|
251
|
+
return await self._get(
|
|
252
|
+
"/api/entities/",
|
|
253
|
+
options=make_request_options(
|
|
254
|
+
extra_headers=extra_headers,
|
|
255
|
+
extra_query=extra_query,
|
|
256
|
+
extra_body=extra_body,
|
|
257
|
+
timeout=timeout,
|
|
258
|
+
query=await async_maybe_transform(
|
|
259
|
+
{
|
|
260
|
+
"cage_code": cage_code,
|
|
261
|
+
"limit": limit,
|
|
262
|
+
"naics": naics,
|
|
263
|
+
"name": name,
|
|
264
|
+
"page": page,
|
|
265
|
+
"psc": psc,
|
|
266
|
+
"purpose_of_registration_code": purpose_of_registration_code,
|
|
267
|
+
"search": search,
|
|
268
|
+
"socioeconomic": socioeconomic,
|
|
269
|
+
"state": state,
|
|
270
|
+
"uei": uei,
|
|
271
|
+
"zip_code": zip_code,
|
|
272
|
+
},
|
|
273
|
+
entity_list_params.EntityListParams,
|
|
274
|
+
),
|
|
275
|
+
),
|
|
276
|
+
cast_to=EntityListResponse,
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
class EntitiesResourceWithRawResponse:
|
|
281
|
+
def __init__(self, entities: EntitiesResource) -> None:
|
|
282
|
+
self._entities = entities
|
|
283
|
+
|
|
284
|
+
self.retrieve = to_raw_response_wrapper(
|
|
285
|
+
entities.retrieve,
|
|
286
|
+
)
|
|
287
|
+
self.list = to_raw_response_wrapper(
|
|
288
|
+
entities.list,
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
class AsyncEntitiesResourceWithRawResponse:
|
|
293
|
+
def __init__(self, entities: AsyncEntitiesResource) -> None:
|
|
294
|
+
self._entities = entities
|
|
295
|
+
|
|
296
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
297
|
+
entities.retrieve,
|
|
298
|
+
)
|
|
299
|
+
self.list = async_to_raw_response_wrapper(
|
|
300
|
+
entities.list,
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
class EntitiesResourceWithStreamingResponse:
|
|
305
|
+
def __init__(self, entities: EntitiesResource) -> None:
|
|
306
|
+
self._entities = entities
|
|
307
|
+
|
|
308
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
309
|
+
entities.retrieve,
|
|
310
|
+
)
|
|
311
|
+
self.list = to_streamed_response_wrapper(
|
|
312
|
+
entities.list,
|
|
313
|
+
)
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
class AsyncEntitiesResourceWithStreamingResponse:
|
|
317
|
+
def __init__(self, entities: AsyncEntitiesResource) -> None:
|
|
318
|
+
self._entities = entities
|
|
319
|
+
|
|
320
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
321
|
+
entities.retrieve,
|
|
322
|
+
)
|
|
323
|
+
self.list = async_to_streamed_response_wrapper(
|
|
324
|
+
entities.list,
|
|
325
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .idvs import (
|
|
4
|
+
IdvsResource,
|
|
5
|
+
AsyncIdvsResource,
|
|
6
|
+
IdvsResourceWithRawResponse,
|
|
7
|
+
AsyncIdvsResourceWithRawResponse,
|
|
8
|
+
IdvsResourceWithStreamingResponse,
|
|
9
|
+
AsyncIdvsResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
from .awards import (
|
|
12
|
+
AwardsResource,
|
|
13
|
+
AsyncAwardsResource,
|
|
14
|
+
AwardsResourceWithRawResponse,
|
|
15
|
+
AsyncAwardsResourceWithRawResponse,
|
|
16
|
+
AwardsResourceWithStreamingResponse,
|
|
17
|
+
AsyncAwardsResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
"AwardsResource",
|
|
22
|
+
"AsyncAwardsResource",
|
|
23
|
+
"AwardsResourceWithRawResponse",
|
|
24
|
+
"AsyncAwardsResourceWithRawResponse",
|
|
25
|
+
"AwardsResourceWithStreamingResponse",
|
|
26
|
+
"AsyncAwardsResourceWithStreamingResponse",
|
|
27
|
+
"IdvsResource",
|
|
28
|
+
"AsyncIdvsResource",
|
|
29
|
+
"IdvsResourceWithRawResponse",
|
|
30
|
+
"AsyncIdvsResourceWithRawResponse",
|
|
31
|
+
"IdvsResourceWithStreamingResponse",
|
|
32
|
+
"AsyncIdvsResourceWithStreamingResponse",
|
|
33
|
+
]
|
|
@@ -0,0 +1,287 @@
|
|
|
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 Union
|
|
6
|
+
from datetime import date
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
|
|
10
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
11
|
+
from ..._utils import (
|
|
12
|
+
maybe_transform,
|
|
13
|
+
async_maybe_transform,
|
|
14
|
+
)
|
|
15
|
+
from ..._compat import cached_property
|
|
16
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
17
|
+
from ..._response import (
|
|
18
|
+
to_raw_response_wrapper,
|
|
19
|
+
to_streamed_response_wrapper,
|
|
20
|
+
async_to_raw_response_wrapper,
|
|
21
|
+
async_to_streamed_response_wrapper,
|
|
22
|
+
)
|
|
23
|
+
from ...types.idvs import award_list_params
|
|
24
|
+
from ..._base_client import make_request_options
|
|
25
|
+
from ...types.idvs.award_list_response import AwardListResponse
|
|
26
|
+
|
|
27
|
+
__all__ = ["AwardsResource", "AsyncAwardsResource"]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class AwardsResource(SyncAPIResource):
|
|
31
|
+
@cached_property
|
|
32
|
+
def with_raw_response(self) -> AwardsResourceWithRawResponse:
|
|
33
|
+
"""
|
|
34
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
35
|
+
the raw response object instead of the parsed content.
|
|
36
|
+
|
|
37
|
+
For more information, see https://www.github.com/makegov/tango-python#accessing-raw-response-data-eg-headers
|
|
38
|
+
"""
|
|
39
|
+
return AwardsResourceWithRawResponse(self)
|
|
40
|
+
|
|
41
|
+
@cached_property
|
|
42
|
+
def with_streaming_response(self) -> AwardsResourceWithStreamingResponse:
|
|
43
|
+
"""
|
|
44
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
45
|
+
|
|
46
|
+
For more information, see https://www.github.com/makegov/tango-python#with_streaming_response
|
|
47
|
+
"""
|
|
48
|
+
return AwardsResourceWithStreamingResponse(self)
|
|
49
|
+
|
|
50
|
+
def list(
|
|
51
|
+
self,
|
|
52
|
+
*,
|
|
53
|
+
path_contract_award_unique_key: str,
|
|
54
|
+
award_date: str | NotGiven = NOT_GIVEN,
|
|
55
|
+
award_date_gte: Union[str, date] | NotGiven = NOT_GIVEN,
|
|
56
|
+
award_date_lte: Union[str, date] | NotGiven = NOT_GIVEN,
|
|
57
|
+
awarding_agency: str | NotGiven = NOT_GIVEN,
|
|
58
|
+
query_contract_award_unique_key: str | NotGiven = NOT_GIVEN,
|
|
59
|
+
fiscal_year: int | NotGiven = NOT_GIVEN,
|
|
60
|
+
fiscal_year_gte: int | NotGiven = NOT_GIVEN,
|
|
61
|
+
fiscal_year_lte: int | NotGiven = NOT_GIVEN,
|
|
62
|
+
funding_agency: str | NotGiven = NOT_GIVEN,
|
|
63
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
64
|
+
naics: str | NotGiven = NOT_GIVEN,
|
|
65
|
+
ordering: str | NotGiven = NOT_GIVEN,
|
|
66
|
+
page: int | NotGiven = NOT_GIVEN,
|
|
67
|
+
psc: str | NotGiven = NOT_GIVEN,
|
|
68
|
+
set_aside: str | NotGiven = NOT_GIVEN,
|
|
69
|
+
uei: str | NotGiven = NOT_GIVEN,
|
|
70
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
71
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
72
|
+
extra_headers: Headers | None = None,
|
|
73
|
+
extra_query: Query | None = None,
|
|
74
|
+
extra_body: Body | None = None,
|
|
75
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
76
|
+
) -> AwardListResponse:
|
|
77
|
+
"""
|
|
78
|
+
API endpoint that allows awards under a specific IDV to be viewed.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
award_date: Filter by the award date
|
|
82
|
+
|
|
83
|
+
awarding_agency: Filter by awarding agency or department
|
|
84
|
+
|
|
85
|
+
query_contract_award_unique_key: The unique key for the contract award.
|
|
86
|
+
|
|
87
|
+
funding_agency: Filter by funding agency or department
|
|
88
|
+
|
|
89
|
+
limit: Number of results to return per page.
|
|
90
|
+
|
|
91
|
+
ordering: Which field to use when ordering the results.
|
|
92
|
+
|
|
93
|
+
page: A page number within the paginated result set.
|
|
94
|
+
|
|
95
|
+
uei: Unique Entity Identifier
|
|
96
|
+
|
|
97
|
+
extra_headers: Send extra headers
|
|
98
|
+
|
|
99
|
+
extra_query: Add additional query parameters to the request
|
|
100
|
+
|
|
101
|
+
extra_body: Add additional JSON properties to the request
|
|
102
|
+
|
|
103
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
104
|
+
"""
|
|
105
|
+
if not path_contract_award_unique_key:
|
|
106
|
+
raise ValueError(
|
|
107
|
+
f"Expected a non-empty value for `path_contract_award_unique_key` but received {path_contract_award_unique_key!r}"
|
|
108
|
+
)
|
|
109
|
+
return self._get(
|
|
110
|
+
f"/api/idvs/{path_contract_award_unique_key}/awards/",
|
|
111
|
+
options=make_request_options(
|
|
112
|
+
extra_headers=extra_headers,
|
|
113
|
+
extra_query=extra_query,
|
|
114
|
+
extra_body=extra_body,
|
|
115
|
+
timeout=timeout,
|
|
116
|
+
query=maybe_transform(
|
|
117
|
+
{
|
|
118
|
+
"award_date": award_date,
|
|
119
|
+
"award_date_gte": award_date_gte,
|
|
120
|
+
"award_date_lte": award_date_lte,
|
|
121
|
+
"awarding_agency": awarding_agency,
|
|
122
|
+
"query_contract_award_unique_key": query_contract_award_unique_key,
|
|
123
|
+
"fiscal_year": fiscal_year,
|
|
124
|
+
"fiscal_year_gte": fiscal_year_gte,
|
|
125
|
+
"fiscal_year_lte": fiscal_year_lte,
|
|
126
|
+
"funding_agency": funding_agency,
|
|
127
|
+
"limit": limit,
|
|
128
|
+
"naics": naics,
|
|
129
|
+
"ordering": ordering,
|
|
130
|
+
"page": page,
|
|
131
|
+
"psc": psc,
|
|
132
|
+
"set_aside": set_aside,
|
|
133
|
+
"uei": uei,
|
|
134
|
+
},
|
|
135
|
+
award_list_params.AwardListParams,
|
|
136
|
+
),
|
|
137
|
+
),
|
|
138
|
+
cast_to=AwardListResponse,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class AsyncAwardsResource(AsyncAPIResource):
|
|
143
|
+
@cached_property
|
|
144
|
+
def with_raw_response(self) -> AsyncAwardsResourceWithRawResponse:
|
|
145
|
+
"""
|
|
146
|
+
This property can be used as a prefix for any HTTP method call to return the
|
|
147
|
+
the raw response object instead of the parsed content.
|
|
148
|
+
|
|
149
|
+
For more information, see https://www.github.com/makegov/tango-python#accessing-raw-response-data-eg-headers
|
|
150
|
+
"""
|
|
151
|
+
return AsyncAwardsResourceWithRawResponse(self)
|
|
152
|
+
|
|
153
|
+
@cached_property
|
|
154
|
+
def with_streaming_response(self) -> AsyncAwardsResourceWithStreamingResponse:
|
|
155
|
+
"""
|
|
156
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
157
|
+
|
|
158
|
+
For more information, see https://www.github.com/makegov/tango-python#with_streaming_response
|
|
159
|
+
"""
|
|
160
|
+
return AsyncAwardsResourceWithStreamingResponse(self)
|
|
161
|
+
|
|
162
|
+
async def list(
|
|
163
|
+
self,
|
|
164
|
+
*,
|
|
165
|
+
path_contract_award_unique_key: str,
|
|
166
|
+
award_date: str | NotGiven = NOT_GIVEN,
|
|
167
|
+
award_date_gte: Union[str, date] | NotGiven = NOT_GIVEN,
|
|
168
|
+
award_date_lte: Union[str, date] | NotGiven = NOT_GIVEN,
|
|
169
|
+
awarding_agency: str | NotGiven = NOT_GIVEN,
|
|
170
|
+
query_contract_award_unique_key: str | NotGiven = NOT_GIVEN,
|
|
171
|
+
fiscal_year: int | NotGiven = NOT_GIVEN,
|
|
172
|
+
fiscal_year_gte: int | NotGiven = NOT_GIVEN,
|
|
173
|
+
fiscal_year_lte: int | NotGiven = NOT_GIVEN,
|
|
174
|
+
funding_agency: str | NotGiven = NOT_GIVEN,
|
|
175
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
176
|
+
naics: str | NotGiven = NOT_GIVEN,
|
|
177
|
+
ordering: str | NotGiven = NOT_GIVEN,
|
|
178
|
+
page: int | NotGiven = NOT_GIVEN,
|
|
179
|
+
psc: str | NotGiven = NOT_GIVEN,
|
|
180
|
+
set_aside: str | NotGiven = NOT_GIVEN,
|
|
181
|
+
uei: str | NotGiven = NOT_GIVEN,
|
|
182
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
183
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
184
|
+
extra_headers: Headers | None = None,
|
|
185
|
+
extra_query: Query | None = None,
|
|
186
|
+
extra_body: Body | None = None,
|
|
187
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
188
|
+
) -> AwardListResponse:
|
|
189
|
+
"""
|
|
190
|
+
API endpoint that allows awards under a specific IDV to be viewed.
|
|
191
|
+
|
|
192
|
+
Args:
|
|
193
|
+
award_date: Filter by the award date
|
|
194
|
+
|
|
195
|
+
awarding_agency: Filter by awarding agency or department
|
|
196
|
+
|
|
197
|
+
query_contract_award_unique_key: The unique key for the contract award.
|
|
198
|
+
|
|
199
|
+
funding_agency: Filter by funding agency or department
|
|
200
|
+
|
|
201
|
+
limit: Number of results to return per page.
|
|
202
|
+
|
|
203
|
+
ordering: Which field to use when ordering the results.
|
|
204
|
+
|
|
205
|
+
page: A page number within the paginated result set.
|
|
206
|
+
|
|
207
|
+
uei: Unique Entity Identifier
|
|
208
|
+
|
|
209
|
+
extra_headers: Send extra headers
|
|
210
|
+
|
|
211
|
+
extra_query: Add additional query parameters to the request
|
|
212
|
+
|
|
213
|
+
extra_body: Add additional JSON properties to the request
|
|
214
|
+
|
|
215
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
216
|
+
"""
|
|
217
|
+
if not path_contract_award_unique_key:
|
|
218
|
+
raise ValueError(
|
|
219
|
+
f"Expected a non-empty value for `path_contract_award_unique_key` but received {path_contract_award_unique_key!r}"
|
|
220
|
+
)
|
|
221
|
+
return await self._get(
|
|
222
|
+
f"/api/idvs/{path_contract_award_unique_key}/awards/",
|
|
223
|
+
options=make_request_options(
|
|
224
|
+
extra_headers=extra_headers,
|
|
225
|
+
extra_query=extra_query,
|
|
226
|
+
extra_body=extra_body,
|
|
227
|
+
timeout=timeout,
|
|
228
|
+
query=await async_maybe_transform(
|
|
229
|
+
{
|
|
230
|
+
"award_date": award_date,
|
|
231
|
+
"award_date_gte": award_date_gte,
|
|
232
|
+
"award_date_lte": award_date_lte,
|
|
233
|
+
"awarding_agency": awarding_agency,
|
|
234
|
+
"query_contract_award_unique_key": query_contract_award_unique_key,
|
|
235
|
+
"fiscal_year": fiscal_year,
|
|
236
|
+
"fiscal_year_gte": fiscal_year_gte,
|
|
237
|
+
"fiscal_year_lte": fiscal_year_lte,
|
|
238
|
+
"funding_agency": funding_agency,
|
|
239
|
+
"limit": limit,
|
|
240
|
+
"naics": naics,
|
|
241
|
+
"ordering": ordering,
|
|
242
|
+
"page": page,
|
|
243
|
+
"psc": psc,
|
|
244
|
+
"set_aside": set_aside,
|
|
245
|
+
"uei": uei,
|
|
246
|
+
},
|
|
247
|
+
award_list_params.AwardListParams,
|
|
248
|
+
),
|
|
249
|
+
),
|
|
250
|
+
cast_to=AwardListResponse,
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
class AwardsResourceWithRawResponse:
|
|
255
|
+
def __init__(self, awards: AwardsResource) -> None:
|
|
256
|
+
self._awards = awards
|
|
257
|
+
|
|
258
|
+
self.list = to_raw_response_wrapper(
|
|
259
|
+
awards.list,
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
class AsyncAwardsResourceWithRawResponse:
|
|
264
|
+
def __init__(self, awards: AsyncAwardsResource) -> None:
|
|
265
|
+
self._awards = awards
|
|
266
|
+
|
|
267
|
+
self.list = async_to_raw_response_wrapper(
|
|
268
|
+
awards.list,
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
class AwardsResourceWithStreamingResponse:
|
|
273
|
+
def __init__(self, awards: AwardsResource) -> None:
|
|
274
|
+
self._awards = awards
|
|
275
|
+
|
|
276
|
+
self.list = to_streamed_response_wrapper(
|
|
277
|
+
awards.list,
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
class AsyncAwardsResourceWithStreamingResponse:
|
|
282
|
+
def __init__(self, awards: AsyncAwardsResource) -> None:
|
|
283
|
+
self._awards = awards
|
|
284
|
+
|
|
285
|
+
self.list = async_to_streamed_response_wrapper(
|
|
286
|
+
awards.list,
|
|
287
|
+
)
|