edx-enterprise-subsidy-client 0.3.3__tar.gz → 0.3.4__tar.gz

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 (19) hide show
  1. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/CHANGELOG.rst +4 -0
  2. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/PKG-INFO +5 -1
  3. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/edx_enterprise_subsidy_client/__init__.py +1 -1
  4. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/edx_enterprise_subsidy_client/client.py +8 -2
  5. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/edx_enterprise_subsidy_client.egg-info/PKG-INFO +5 -1
  6. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/tests/test_client.py +8 -4
  7. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/LICENSE +0 -0
  8. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/LICENSE.txt +0 -0
  9. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/MANIFEST.in +0 -0
  10. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/README.rst +0 -0
  11. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/edx_enterprise_subsidy_client.egg-info/SOURCES.txt +0 -0
  12. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/edx_enterprise_subsidy_client.egg-info/dependency_links.txt +0 -0
  13. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/edx_enterprise_subsidy_client.egg-info/not-zip-safe +0 -0
  14. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/edx_enterprise_subsidy_client.egg-info/requires.txt +0 -0
  15. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/edx_enterprise_subsidy_client.egg-info/top_level.txt +0 -0
  16. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/requirements/base.in +0 -0
  17. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/requirements/constraints.txt +0 -0
  18. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/setup.cfg +0 -0
  19. {edx-enterprise-subsidy-client-0.3.3 → edx-enterprise-subsidy-client-0.3.4}/setup.py +0 -0
@@ -17,6 +17,10 @@ Unreleased
17
17
  * Switch from ``edx-sphinx-theme`` to ``sphinx-book-theme`` since the former is
18
18
  deprecated
19
19
 
20
+ [0.3.3]
21
+ *******
22
+ * allow additional query params, like ``page_size``, to be passed through to listing endpoints.
23
+
20
24
  [0.3.3]
21
25
  *******
22
26
  * admin-list transactions will also be filtered by ``created`` state by default.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: edx-enterprise-subsidy-client
3
- Version: 0.3.3
3
+ Version: 0.3.4
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
@@ -227,6 +227,10 @@ Unreleased
227
227
  * Switch from ``edx-sphinx-theme`` to ``sphinx-book-theme`` since the former is
228
228
  deprecated
229
229
 
230
+ [0.3.3]
231
+ *******
232
+ * allow additional query params, like ``page_size``, to be passed through to listing endpoints.
233
+
230
234
  [0.3.3]
231
235
  *******
232
236
  * admin-list transactions will also be filtered by ``created`` state by default.
@@ -2,6 +2,6 @@
2
2
  Client for interacting with the enterprise-subsidy service..
3
3
  """
4
4
 
5
- __version__ = '0.3.3'
5
+ __version__ = '0.3.4'
6
6
 
7
7
  from .client import EnterpriseSubsidyAPIClient, EnterpriseSubsidyAPIClientV2, get_enterprise_subsidy_api_client
@@ -108,7 +108,7 @@ class EnterpriseSubsidyAPIClient:
108
108
  raise exc
109
109
  return response_data.json()
110
110
 
111
- def list_subsidies(self, enterprise_customer_uuid):
111
+ def list_subsidies(self, enterprise_customer_uuid, **kwargs):
112
112
  """
113
113
  Client method to list enterprise subsidy records for the given enterprise_customer_uuid.
114
114
 
@@ -137,9 +137,11 @@ class EnterpriseSubsidyAPIClient:
137
137
  }
138
138
  ```
139
139
  """
140
+ query_params = {'enterprise_customer_uuid': enterprise_customer_uuid}
141
+ query_params.update(kwargs)
140
142
  response = self.client.get(
141
143
  self.SUBSIDIES_ENDPOINT,
142
- params={'enterprise_customer_uuid': enterprise_customer_uuid}
144
+ params=query_params,
143
145
  )
144
146
  response.raise_for_status()
145
147
  return response.json()
@@ -158,11 +160,13 @@ class EnterpriseSubsidyAPIClient:
158
160
  self, subsidy_uuid, include_aggregates=True,
159
161
  lms_user_id=None, content_key=None,
160
162
  subsidy_access_policy_uuid=None,
163
+ **kwargs
161
164
  ):
162
165
  """
163
166
  TODO: add docstring.
164
167
  """
165
168
  query_params = {'subsidy_uuid': subsidy_uuid}
169
+ query_params.update(kwargs)
166
170
  if include_aggregates:
167
171
  query_params['include_aggregates'] = include_aggregates
168
172
  if lms_user_id:
@@ -247,6 +251,7 @@ class EnterpriseSubsidyAPIClientV2(EnterpriseSubsidyAPIClient): # pylint: disab
247
251
  self, subsidy_uuid, include_aggregates=True,
248
252
  lms_user_id=None, content_key=None,
249
253
  subsidy_access_policy_uuid=None, transaction_states=None,
254
+ **kwargs,
250
255
  ):
251
256
  """
252
257
  List transactions in a subsidy with admin- or operator-level permissions.
@@ -258,6 +263,7 @@ class EnterpriseSubsidyAPIClientV2(EnterpriseSubsidyAPIClient): # pylint: disab
258
263
  TransactionStateChoices.CREATED,
259
264
  ],
260
265
  }
266
+ query_params.update(kwargs)
261
267
  if include_aggregates:
262
268
  query_params['include_aggregates'] = include_aggregates
263
269
  if lms_user_id:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: edx-enterprise-subsidy-client
3
- Version: 0.3.3
3
+ Version: 0.3.4
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
@@ -227,6 +227,10 @@ Unreleased
227
227
  * Switch from ``edx-sphinx-theme`` to ``sphinx-book-theme`` since the former is
228
228
  deprecated
229
229
 
230
+ [0.3.3]
231
+ *******
232
+ * allow additional query params, like ``page_size``, to be passed through to listing endpoints.
233
+
230
234
  [0.3.3]
231
235
  *******
232
236
  * admin-list transactions will also be filtered by ``created`` state by default.
@@ -64,21 +64,24 @@ def test_v2_list_subsidy_transactions(
64
64
 
65
65
  data_driven_test = [
66
66
  (
67
- {'transaction_states': ['committed', 'pending', 'district-of-columbia']},
67
+ {
68
+ 'page_size': 1,
69
+ 'transaction_states': ['committed', 'pending', 'district-of-columbia'],
70
+ },
68
71
  ['committed', 'pending'],
69
72
  ),
70
73
  (
71
- {},
74
+ {'page_size': 1},
72
75
  ['committed', 'pending', 'created'],
73
76
  ),
74
77
  ]
75
- for state_kwargs, expected_state_call_param in data_driven_test:
78
+ for kwargs, expected_state_call_param in data_driven_test:
76
79
  response = subsidy_service_client.list_subsidy_transactions(
77
80
  subsidy_uuid=subsidy_uuid,
78
81
  lms_user_id=lms_user_id,
79
82
  content_key=content_key,
80
83
  subsidy_access_policy_uuid=subsidy_access_policy_uuid,
81
- **state_kwargs,
84
+ **kwargs,
82
85
  )
83
86
 
84
87
  assert response == mocked_response_data
@@ -90,5 +93,6 @@ def test_v2_list_subsidy_transactions(
90
93
  'lms_user_id': 123,
91
94
  'content_key': 'the-best-content',
92
95
  'subsidy_access_policy_uuid': str(subsidy_access_policy_uuid),
96
+ 'page_size': 1,
93
97
  },
94
98
  )