edx-enterprise-subsidy-client 0.4.3__py2.py3-none-any.whl → 1.0.0__py2.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.
- edx_enterprise_subsidy_client/__init__.py +1 -1
- edx_enterprise_subsidy_client/client.py +41 -0
- {edx_enterprise_subsidy_client-0.4.3.dist-info → edx_enterprise_subsidy_client-1.0.0.dist-info}/METADATA +32 -4
- edx_enterprise_subsidy_client-1.0.0.dist-info/RECORD +8 -0
- {edx_enterprise_subsidy_client-0.4.3.dist-info → edx_enterprise_subsidy_client-1.0.0.dist-info}/WHEEL +1 -1
- edx_enterprise_subsidy_client-0.4.3.dist-info/RECORD +0 -8
- {edx_enterprise_subsidy_client-0.4.3.dist-info → edx_enterprise_subsidy_client-1.0.0.dist-info}/LICENSE +0 -0
- {edx_enterprise_subsidy_client-0.4.3.dist-info → edx_enterprise_subsidy_client-1.0.0.dist-info}/LICENSE.txt +0 -0
- {edx_enterprise_subsidy_client-0.4.3.dist-info → edx_enterprise_subsidy_client-1.0.0.dist-info}/top_level.txt +0 -0
|
@@ -291,6 +291,7 @@ class EnterpriseSubsidyAPIClientV2(EnterpriseSubsidyAPIClient): # pylint: disab
|
|
|
291
291
|
"""
|
|
292
292
|
V2_BASE_URL = EnterpriseSubsidyAPIClient.API_BASE_URL + 'v2/'
|
|
293
293
|
TRANSACTIONS_LIST_ENDPOINT = V2_BASE_URL + 'subsidies/{subsidy_uuid}/admin/transactions/'
|
|
294
|
+
DEPOSITS_CREATE_ENDPOINT = V2_BASE_URL + 'subsidies/{subsidy_uuid}/admin/deposits/'
|
|
294
295
|
|
|
295
296
|
def list_subsidy_transactions(
|
|
296
297
|
self, subsidy_uuid, include_aggregates=True,
|
|
@@ -370,3 +371,43 @@ class EnterpriseSubsidyAPIClientV2(EnterpriseSubsidyAPIClient): # pylint: disab
|
|
|
370
371
|
)
|
|
371
372
|
response.raise_for_status()
|
|
372
373
|
return response.json()
|
|
374
|
+
|
|
375
|
+
def create_subsidy_deposit(
|
|
376
|
+
self,
|
|
377
|
+
subsidy_uuid,
|
|
378
|
+
desired_deposit_quantity,
|
|
379
|
+
sales_contract_reference_id,
|
|
380
|
+
sales_contract_reference_provider,
|
|
381
|
+
metadata=None,
|
|
382
|
+
idempotency_key=None,
|
|
383
|
+
):
|
|
384
|
+
"""
|
|
385
|
+
Creates a deposit in the given subsidy, requires operator-level permissions.
|
|
386
|
+
|
|
387
|
+
Raises:
|
|
388
|
+
requests.exceptions.HTTPError:
|
|
389
|
+
- 403 Forbidden: If auth failed.
|
|
390
|
+
- 429 Too Many Requests: If the ledger was locked (resource contention, try again later).
|
|
391
|
+
- 400 Bad Request: If any of the values were invalid. Reasons include:
|
|
392
|
+
* non-positive quantity.
|
|
393
|
+
* provider slug does not exist in database.
|
|
394
|
+
- 422 Unprocessable Entity: Catchall status for anything that prevented the deposit from being
|
|
395
|
+
created. Reasons include, but are not limited to:
|
|
396
|
+
* Subsidy is inactive.
|
|
397
|
+
* Another deposit with same idempotency_key already exists.
|
|
398
|
+
"""
|
|
399
|
+
request_payload = {
|
|
400
|
+
'desired_deposit_quantity': desired_deposit_quantity,
|
|
401
|
+
'sales_contract_reference_id': sales_contract_reference_id,
|
|
402
|
+
'sales_contract_reference_provider': sales_contract_reference_provider,
|
|
403
|
+
}
|
|
404
|
+
if metadata is not None:
|
|
405
|
+
request_payload['metadata'] = metadata
|
|
406
|
+
if idempotency_key is not None:
|
|
407
|
+
request_payload['idempotency_key'] = idempotency_key
|
|
408
|
+
response = self.client.post(
|
|
409
|
+
self.DEPOSITS_CREATE_ENDPOINT.format(subsidy_uuid=subsidy_uuid),
|
|
410
|
+
json=request_payload,
|
|
411
|
+
)
|
|
412
|
+
response.raise_for_status()
|
|
413
|
+
return response.json()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: edx-enterprise-subsidy-client
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Client for interacting with the enterprise-subsidy service.
|
|
5
5
|
Home-page: https://github.com/openedx/edx-enterprise-subsidy-client
|
|
6
6
|
Author: edX
|
|
@@ -12,11 +12,21 @@ Classifier: Intended Audience :: Developers
|
|
|
12
12
|
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
|
13
13
|
Classifier: Natural Language :: English
|
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.
|
|
16
|
-
Requires-Python: >=3.
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Requires-Python: >=3.12
|
|
17
17
|
License-File: LICENSE
|
|
18
18
|
License-File: LICENSE.txt
|
|
19
19
|
Requires-Dist: edx-rest-api-client
|
|
20
|
+
Dynamic: author
|
|
21
|
+
Dynamic: author-email
|
|
22
|
+
Dynamic: classifier
|
|
23
|
+
Dynamic: description
|
|
24
|
+
Dynamic: home-page
|
|
25
|
+
Dynamic: keywords
|
|
26
|
+
Dynamic: license
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: requires-python
|
|
29
|
+
Dynamic: summary
|
|
20
30
|
|
|
21
31
|
edx-enterprise-subsidy-client
|
|
22
32
|
#############################
|
|
@@ -225,6 +235,24 @@ Change Log
|
|
|
225
235
|
Unreleased
|
|
226
236
|
**********
|
|
227
237
|
|
|
238
|
+
[1.0.0]
|
|
239
|
+
*******
|
|
240
|
+
* fix: Remove Python 3.8 Support
|
|
241
|
+
* chore: Update Python Requirements
|
|
242
|
+
* chore: Update pylintrc
|
|
243
|
+
|
|
244
|
+
[0.4.6]
|
|
245
|
+
*******
|
|
246
|
+
* fix: Update the name of reviewers team in github flow
|
|
247
|
+
|
|
248
|
+
[0.4.5]
|
|
249
|
+
*******
|
|
250
|
+
* fix: create_subsidy_deposit - metadata is optional (ENT-9133)
|
|
251
|
+
|
|
252
|
+
[0.4.4]
|
|
253
|
+
*******
|
|
254
|
+
* feat: add support for deposit creation (ENT-9133)
|
|
255
|
+
|
|
228
256
|
[0.4.3]
|
|
229
257
|
*******
|
|
230
258
|
* feat: adding new subsidy client method to fetch subsidy aggregate data
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
edx_enterprise_subsidy_client/__init__.py,sha256=YCmaYBnrCruOG6IjN7HZ7vKXrZqnUiCZksGHWaziadM,205
|
|
2
|
+
edx_enterprise_subsidy_client/client.py,sha256=ueCdV8Fb3hufsTqbNIjIjvK4Wz3grc9UpKCsk_uO1lw,15048
|
|
3
|
+
edx_enterprise_subsidy_client-1.0.0.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
4
|
+
edx_enterprise_subsidy_client-1.0.0.dist-info/LICENSE.txt,sha256=QTW2QN7q3XszgUAXm9Dzgtu5LXYKbR1SGnqMa7ufEuY,35139
|
|
5
|
+
edx_enterprise_subsidy_client-1.0.0.dist-info/METADATA,sha256=zNVIcSFmg0k2YfotgznHgvxznDhmEenUXOh5LqXJmKs,10119
|
|
6
|
+
edx_enterprise_subsidy_client-1.0.0.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
|
|
7
|
+
edx_enterprise_subsidy_client-1.0.0.dist-info/top_level.txt,sha256=X3PxOH44rjQXFaA8EX-ZpUEL4SjfMM_yUkS-KbvNIZk,30
|
|
8
|
+
edx_enterprise_subsidy_client-1.0.0.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
edx_enterprise_subsidy_client/__init__.py,sha256=ohnfF6pu_QiBBqJuz8O3HJhED7cUdSsYU2qj5HDT0fI,205
|
|
2
|
-
edx_enterprise_subsidy_client/client.py,sha256=omt6lIVuGu4GtbYu45u5ghCKUzg-309EDpnGqldTWMw,13212
|
|
3
|
-
edx_enterprise_subsidy_client-0.4.3.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
4
|
-
edx_enterprise_subsidy_client-0.4.3.dist-info/LICENSE.txt,sha256=QTW2QN7q3XszgUAXm9Dzgtu5LXYKbR1SGnqMa7ufEuY,35139
|
|
5
|
-
edx_enterprise_subsidy_client-0.4.3.dist-info/METADATA,sha256=9QwvAwDzaH4HDoiSPyv30l8VfJADkUajv1qFGZ64Aeg,9585
|
|
6
|
-
edx_enterprise_subsidy_client-0.4.3.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
|
7
|
-
edx_enterprise_subsidy_client-0.4.3.dist-info/top_level.txt,sha256=X3PxOH44rjQXFaA8EX-ZpUEL4SjfMM_yUkS-KbvNIZk,30
|
|
8
|
-
edx_enterprise_subsidy_client-0.4.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|