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.
Files changed (94) hide show
  1. tango/__init__.py +83 -0
  2. tango/_base_client.py +2045 -0
  3. tango/_client.py +544 -0
  4. tango/_compat.py +219 -0
  5. tango/_constants.py +14 -0
  6. tango/_exceptions.py +108 -0
  7. tango/_files.py +123 -0
  8. tango/_models.py +788 -0
  9. tango/_qs.py +150 -0
  10. tango/_resource.py +43 -0
  11. tango/_response.py +824 -0
  12. tango/_streaming.py +333 -0
  13. tango/_types.py +219 -0
  14. tango/_utils/__init__.py +56 -0
  15. tango/_utils/_logs.py +25 -0
  16. tango/_utils/_proxy.py +62 -0
  17. tango/_utils/_reflection.py +42 -0
  18. tango/_utils/_streams.py +12 -0
  19. tango/_utils/_sync.py +71 -0
  20. tango/_utils/_transform.py +392 -0
  21. tango/_utils/_typing.py +120 -0
  22. tango/_utils/_utils.py +414 -0
  23. tango/_version.py +4 -0
  24. tango/lib/.keep +4 -0
  25. tango/py.typed +0 -0
  26. tango/resources/__init__.py +229 -0
  27. tango/resources/agencies.py +255 -0
  28. tango/resources/assistance_listings.py +214 -0
  29. tango/resources/bulk/__init__.py +33 -0
  30. tango/resources/bulk/bulk.py +102 -0
  31. tango/resources/bulk/entities.py +152 -0
  32. tango/resources/business_types.py +218 -0
  33. tango/resources/contracts.py +381 -0
  34. tango/resources/departments.py +210 -0
  35. tango/resources/entities.py +325 -0
  36. tango/resources/idvs/__init__.py +33 -0
  37. tango/resources/idvs/awards.py +287 -0
  38. tango/resources/idvs/idvs.py +413 -0
  39. tango/resources/naics.py +317 -0
  40. tango/resources/notices.py +391 -0
  41. tango/resources/offices.py +281 -0
  42. tango/resources/opportunities.py +420 -0
  43. tango/resources/pscs.py +210 -0
  44. tango/resources/schemas.py +398 -0
  45. tango/resources/subawards.py +313 -0
  46. tango/resources/versions.py +136 -0
  47. tango/types/__init__.py +43 -0
  48. tango/types/agency.py +17 -0
  49. tango/types/agency_list_params.py +14 -0
  50. tango/types/agency_list_response.py +10 -0
  51. tango/types/assistance_listing.py +12 -0
  52. tango/types/assistance_listing_list_response.py +10 -0
  53. tango/types/assistance_listing_retrieve_response.py +26 -0
  54. tango/types/bulk/__init__.py +3 -0
  55. tango/types/business_type.py +14 -0
  56. tango/types/business_type_list_response.py +10 -0
  57. tango/types/contract_list_params.py +78 -0
  58. tango/types/contract_list_response.py +55 -0
  59. tango/types/contract_retrieve_response.py +51 -0
  60. tango/types/department.py +16 -0
  61. tango/types/department_list_response.py +10 -0
  62. tango/types/entity_list_params.py +38 -0
  63. tango/types/entity_list_response.py +37 -0
  64. tango/types/entity_retrieve_response.py +116 -0
  65. tango/types/idv.py +102 -0
  66. tango/types/idv_list_params.py +78 -0
  67. tango/types/idv_list_response.py +27 -0
  68. tango/types/idvs/__init__.py +6 -0
  69. tango/types/idvs/award_list_params.py +55 -0
  70. tango/types/idvs/award_list_response.py +55 -0
  71. tango/types/naic_list_params.py +47 -0
  72. tango/types/naic_list_response.py +10 -0
  73. tango/types/naic_retrieve_response.py +13 -0
  74. tango/types/naics_code.py +13 -0
  75. tango/types/notice_list_params.py +81 -0
  76. tango/types/notice_list_response.py +60 -0
  77. tango/types/notice_retrieve_response.py +93 -0
  78. tango/types/office.py +15 -0
  79. tango/types/office_list_params.py +18 -0
  80. tango/types/office_list_response.py +18 -0
  81. tango/types/opportunity_list_params.py +97 -0
  82. tango/types/opportunity_list_response.py +101 -0
  83. tango/types/opportunity_retrieve_response.py +123 -0
  84. tango/types/product_service_code.py +21 -0
  85. tango/types/psc_list_response.py +10 -0
  86. tango/types/schema_retrieve_params.py +113 -0
  87. tango/types/schema_retrieve_response.py +8 -0
  88. tango/types/subaward.py +172 -0
  89. tango/types/subaward_list_params.py +33 -0
  90. tango/types/subaward_list_response.py +18 -0
  91. tango_python-0.0.1a1.dist-info/METADATA +359 -0
  92. tango_python-0.0.1a1.dist-info/RECORD +94 -0
  93. tango_python-0.0.1a1.dist-info/WHEEL +4 -0
  94. tango_python-0.0.1a1.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,152 @@
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 NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
8
+ from ..._compat import cached_property
9
+ from ..._resource import SyncAPIResource, AsyncAPIResource
10
+ from ..._response import (
11
+ to_raw_response_wrapper,
12
+ to_streamed_response_wrapper,
13
+ async_to_raw_response_wrapper,
14
+ async_to_streamed_response_wrapper,
15
+ )
16
+ from ..._base_client import make_request_options
17
+
18
+ __all__ = ["EntitiesResource", "AsyncEntitiesResource"]
19
+
20
+
21
+ class EntitiesResource(SyncAPIResource):
22
+ @cached_property
23
+ def with_raw_response(self) -> EntitiesResourceWithRawResponse:
24
+ """
25
+ This property can be used as a prefix for any HTTP method call to return the
26
+ the raw response object instead of the parsed content.
27
+
28
+ For more information, see https://www.github.com/makegov/tango-python#accessing-raw-response-data-eg-headers
29
+ """
30
+ return EntitiesResourceWithRawResponse(self)
31
+
32
+ @cached_property
33
+ def with_streaming_response(self) -> EntitiesResourceWithStreamingResponse:
34
+ """
35
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
36
+
37
+ For more information, see https://www.github.com/makegov/tango-python#with_streaming_response
38
+ """
39
+ return EntitiesResourceWithStreamingResponse(self)
40
+
41
+ def list(
42
+ self,
43
+ *,
44
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
45
+ # The extra values given here take precedence over values defined on the client or passed to this method.
46
+ extra_headers: Headers | None = None,
47
+ extra_query: Query | None = None,
48
+ extra_body: Body | None = None,
49
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
50
+ ) -> None:
51
+ """
52
+ Mixin to configure OAuth2 authentication for API views.
53
+
54
+ Requires:
55
+
56
+ - OAuth2 authentication
57
+ - Authenticated users or valid token with required scopes
58
+ - 'read' scope by default
59
+ """
60
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
61
+ return self._get(
62
+ "/api/bulk/entities",
63
+ options=make_request_options(
64
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
65
+ ),
66
+ cast_to=NoneType,
67
+ )
68
+
69
+
70
+ class AsyncEntitiesResource(AsyncAPIResource):
71
+ @cached_property
72
+ def with_raw_response(self) -> AsyncEntitiesResourceWithRawResponse:
73
+ """
74
+ This property can be used as a prefix for any HTTP method call to return the
75
+ the raw response object instead of the parsed content.
76
+
77
+ For more information, see https://www.github.com/makegov/tango-python#accessing-raw-response-data-eg-headers
78
+ """
79
+ return AsyncEntitiesResourceWithRawResponse(self)
80
+
81
+ @cached_property
82
+ def with_streaming_response(self) -> AsyncEntitiesResourceWithStreamingResponse:
83
+ """
84
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
85
+
86
+ For more information, see https://www.github.com/makegov/tango-python#with_streaming_response
87
+ """
88
+ return AsyncEntitiesResourceWithStreamingResponse(self)
89
+
90
+ async def list(
91
+ self,
92
+ *,
93
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
94
+ # The extra values given here take precedence over values defined on the client or passed to this method.
95
+ extra_headers: Headers | None = None,
96
+ extra_query: Query | None = None,
97
+ extra_body: Body | None = None,
98
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
99
+ ) -> None:
100
+ """
101
+ Mixin to configure OAuth2 authentication for API views.
102
+
103
+ Requires:
104
+
105
+ - OAuth2 authentication
106
+ - Authenticated users or valid token with required scopes
107
+ - 'read' scope by default
108
+ """
109
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
110
+ return await self._get(
111
+ "/api/bulk/entities",
112
+ options=make_request_options(
113
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
114
+ ),
115
+ cast_to=NoneType,
116
+ )
117
+
118
+
119
+ class EntitiesResourceWithRawResponse:
120
+ def __init__(self, entities: EntitiesResource) -> None:
121
+ self._entities = entities
122
+
123
+ self.list = to_raw_response_wrapper(
124
+ entities.list,
125
+ )
126
+
127
+
128
+ class AsyncEntitiesResourceWithRawResponse:
129
+ def __init__(self, entities: AsyncEntitiesResource) -> None:
130
+ self._entities = entities
131
+
132
+ self.list = async_to_raw_response_wrapper(
133
+ entities.list,
134
+ )
135
+
136
+
137
+ class EntitiesResourceWithStreamingResponse:
138
+ def __init__(self, entities: EntitiesResource) -> None:
139
+ self._entities = entities
140
+
141
+ self.list = to_streamed_response_wrapper(
142
+ entities.list,
143
+ )
144
+
145
+
146
+ class AsyncEntitiesResourceWithStreamingResponse:
147
+ def __init__(self, entities: AsyncEntitiesResource) -> None:
148
+ self._entities = entities
149
+
150
+ self.list = async_to_streamed_response_wrapper(
151
+ entities.list,
152
+ )
@@ -0,0 +1,218 @@
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 NOT_GIVEN, Body, Query, Headers, NotGiven
8
+ from .._compat import cached_property
9
+ from .._resource import SyncAPIResource, AsyncAPIResource
10
+ from .._response import (
11
+ to_raw_response_wrapper,
12
+ to_streamed_response_wrapper,
13
+ async_to_raw_response_wrapper,
14
+ async_to_streamed_response_wrapper,
15
+ )
16
+ from .._base_client import make_request_options
17
+ from ..types.business_type import BusinessType
18
+ from ..types.business_type_list_response import BusinessTypeListResponse
19
+
20
+ __all__ = ["BusinessTypesResource", "AsyncBusinessTypesResource"]
21
+
22
+
23
+ class BusinessTypesResource(SyncAPIResource):
24
+ @cached_property
25
+ def with_raw_response(self) -> BusinessTypesResourceWithRawResponse:
26
+ """
27
+ This property can be used as a prefix for any HTTP method call to return the
28
+ the raw response object instead of the parsed content.
29
+
30
+ For more information, see https://www.github.com/makegov/tango-python#accessing-raw-response-data-eg-headers
31
+ """
32
+ return BusinessTypesResourceWithRawResponse(self)
33
+
34
+ @cached_property
35
+ def with_streaming_response(self) -> BusinessTypesResourceWithStreamingResponse:
36
+ """
37
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
38
+
39
+ For more information, see https://www.github.com/makegov/tango-python#with_streaming_response
40
+ """
41
+ return BusinessTypesResourceWithStreamingResponse(self)
42
+
43
+ def retrieve(
44
+ self,
45
+ code: str,
46
+ *,
47
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
48
+ # The extra values given here take precedence over values defined on the client or passed to this method.
49
+ extra_headers: Headers | None = None,
50
+ extra_query: Query | None = None,
51
+ extra_body: Body | None = None,
52
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
53
+ ) -> BusinessType:
54
+ """
55
+ API endpoint that allows Business Types to be viewed.
56
+
57
+ Args:
58
+ code: The SAM code for the business type
59
+
60
+ extra_headers: Send extra headers
61
+
62
+ extra_query: Add additional query parameters to the request
63
+
64
+ extra_body: Add additional JSON properties to the request
65
+
66
+ timeout: Override the client-level default timeout for this request, in seconds
67
+ """
68
+ if not code:
69
+ raise ValueError(f"Expected a non-empty value for `code` but received {code!r}")
70
+ return self._get(
71
+ f"/api/business_types/{code}/",
72
+ options=make_request_options(
73
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
74
+ ),
75
+ cast_to=BusinessType,
76
+ )
77
+
78
+ def list(
79
+ self,
80
+ *,
81
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
82
+ # The extra values given here take precedence over values defined on the client or passed to this method.
83
+ extra_headers: Headers | None = None,
84
+ extra_query: Query | None = None,
85
+ extra_body: Body | None = None,
86
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
87
+ ) -> BusinessTypeListResponse:
88
+ """API endpoint that allows Business Types to be viewed."""
89
+ return self._get(
90
+ "/api/business_types/",
91
+ options=make_request_options(
92
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
93
+ ),
94
+ cast_to=BusinessTypeListResponse,
95
+ )
96
+
97
+
98
+ class AsyncBusinessTypesResource(AsyncAPIResource):
99
+ @cached_property
100
+ def with_raw_response(self) -> AsyncBusinessTypesResourceWithRawResponse:
101
+ """
102
+ This property can be used as a prefix for any HTTP method call to return the
103
+ the raw response object instead of the parsed content.
104
+
105
+ For more information, see https://www.github.com/makegov/tango-python#accessing-raw-response-data-eg-headers
106
+ """
107
+ return AsyncBusinessTypesResourceWithRawResponse(self)
108
+
109
+ @cached_property
110
+ def with_streaming_response(self) -> AsyncBusinessTypesResourceWithStreamingResponse:
111
+ """
112
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
113
+
114
+ For more information, see https://www.github.com/makegov/tango-python#with_streaming_response
115
+ """
116
+ return AsyncBusinessTypesResourceWithStreamingResponse(self)
117
+
118
+ async def retrieve(
119
+ self,
120
+ code: str,
121
+ *,
122
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
123
+ # The extra values given here take precedence over values defined on the client or passed to this method.
124
+ extra_headers: Headers | None = None,
125
+ extra_query: Query | None = None,
126
+ extra_body: Body | None = None,
127
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
128
+ ) -> BusinessType:
129
+ """
130
+ API endpoint that allows Business Types to be viewed.
131
+
132
+ Args:
133
+ code: The SAM code for the business type
134
+
135
+ extra_headers: Send extra headers
136
+
137
+ extra_query: Add additional query parameters to the request
138
+
139
+ extra_body: Add additional JSON properties to the request
140
+
141
+ timeout: Override the client-level default timeout for this request, in seconds
142
+ """
143
+ if not code:
144
+ raise ValueError(f"Expected a non-empty value for `code` but received {code!r}")
145
+ return await self._get(
146
+ f"/api/business_types/{code}/",
147
+ options=make_request_options(
148
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
149
+ ),
150
+ cast_to=BusinessType,
151
+ )
152
+
153
+ async def list(
154
+ self,
155
+ *,
156
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
157
+ # The extra values given here take precedence over values defined on the client or passed to this method.
158
+ extra_headers: Headers | None = None,
159
+ extra_query: Query | None = None,
160
+ extra_body: Body | None = None,
161
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
162
+ ) -> BusinessTypeListResponse:
163
+ """API endpoint that allows Business Types to be viewed."""
164
+ return await self._get(
165
+ "/api/business_types/",
166
+ options=make_request_options(
167
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
168
+ ),
169
+ cast_to=BusinessTypeListResponse,
170
+ )
171
+
172
+
173
+ class BusinessTypesResourceWithRawResponse:
174
+ def __init__(self, business_types: BusinessTypesResource) -> None:
175
+ self._business_types = business_types
176
+
177
+ self.retrieve = to_raw_response_wrapper(
178
+ business_types.retrieve,
179
+ )
180
+ self.list = to_raw_response_wrapper(
181
+ business_types.list,
182
+ )
183
+
184
+
185
+ class AsyncBusinessTypesResourceWithRawResponse:
186
+ def __init__(self, business_types: AsyncBusinessTypesResource) -> None:
187
+ self._business_types = business_types
188
+
189
+ self.retrieve = async_to_raw_response_wrapper(
190
+ business_types.retrieve,
191
+ )
192
+ self.list = async_to_raw_response_wrapper(
193
+ business_types.list,
194
+ )
195
+
196
+
197
+ class BusinessTypesResourceWithStreamingResponse:
198
+ def __init__(self, business_types: BusinessTypesResource) -> None:
199
+ self._business_types = business_types
200
+
201
+ self.retrieve = to_streamed_response_wrapper(
202
+ business_types.retrieve,
203
+ )
204
+ self.list = to_streamed_response_wrapper(
205
+ business_types.list,
206
+ )
207
+
208
+
209
+ class AsyncBusinessTypesResourceWithStreamingResponse:
210
+ def __init__(self, business_types: AsyncBusinessTypesResource) -> None:
211
+ self._business_types = business_types
212
+
213
+ self.retrieve = async_to_streamed_response_wrapper(
214
+ business_types.retrieve,
215
+ )
216
+ self.list = async_to_streamed_response_wrapper(
217
+ business_types.list,
218
+ )