edx-enterprise-subsidy-client 0.3.2__py2.py3-none-any.whl → 0.3.4__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.
@@ -2,6 +2,6 @@
2
2
  Client for interacting with the enterprise-subsidy service..
3
3
  """
4
4
 
5
- __version__ = '0.3.2'
5
+ __version__ = '0.3.4'
6
6
 
7
7
  from .client import EnterpriseSubsidyAPIClient, EnterpriseSubsidyAPIClientV2, get_enterprise_subsidy_api_client
@@ -74,8 +74,8 @@ class EnterpriseSubsidyAPIClient:
74
74
  )
75
75
 
76
76
  def get_content_metadata_url(self, content_identifier):
77
- """Helper method to generate the subsidy service metadata API url."""
78
- return self.CONTENT_METADATA_ENDPOINT + content_identifier
77
+ """Helper method to generate the subsidy service metadata API url, with a trailing slash."""
78
+ return self.CONTENT_METADATA_ENDPOINT + content_identifier + '/'
79
79
 
80
80
  def get_subsidy_content_data(self, enterprise_customer_uuid, content_identifier):
81
81
  """
@@ -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,13 +251,19 @@ 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.
253
258
  """
254
259
  query_params = {
255
- 'state': [TransactionStateChoices.COMMITTED, TransactionStateChoices.PENDING],
260
+ 'state': [
261
+ TransactionStateChoices.COMMITTED,
262
+ TransactionStateChoices.PENDING,
263
+ TransactionStateChoices.CREATED,
264
+ ],
256
265
  }
266
+ query_params.update(kwargs)
257
267
  if include_aggregates:
258
268
  query_params['include_aggregates'] = include_aggregates
259
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.2
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
@@ -228,6 +228,15 @@ Unreleased
228
228
  * Switch from ``edx-sphinx-theme`` to ``sphinx-book-theme`` since the former is
229
229
  deprecated
230
230
 
231
+ [0.3.3]
232
+ *******
233
+ * allow additional query params, like ``page_size``, to be passed through to listing endpoints.
234
+
235
+ [0.3.3]
236
+ *******
237
+ * admin-list transactions will also be filtered by ``created`` state by default.
238
+ * Adds an ADR explaining the default states for which this client filters transactions.
239
+
231
240
  [0.3.2]
232
241
  *******
233
242
  * admin-list transactions will ask to be filtered for only `committed` and `pending` states by default.
@@ -0,0 +1,8 @@
1
+ edx_enterprise_subsidy_client/__init__.py,sha256=LIJiPyUyOGH2AcSpNi0nqAZd1W2pkf-wPJt5uyz4qj0,205
2
+ edx_enterprise_subsidy_client/client.py,sha256=oSqy1V3i-FF9JQJds-xR_1yiSiCSFlmxYVGUqZmjGEc,10723
3
+ edx_enterprise_subsidy_client-0.3.4.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
4
+ edx_enterprise_subsidy_client-0.3.4.dist-info/LICENSE.txt,sha256=QTW2QN7q3XszgUAXm9Dzgtu5LXYKbR1SGnqMa7ufEuY,35139
5
+ edx_enterprise_subsidy_client-0.3.4.dist-info/METADATA,sha256=PJnGe883GnmROBWk_4ROwS3_XFt4zpJIE31jHzDXLFI,9057
6
+ edx_enterprise_subsidy_client-0.3.4.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
7
+ edx_enterprise_subsidy_client-0.3.4.dist-info/top_level.txt,sha256=X3PxOH44rjQXFaA8EX-ZpUEL4SjfMM_yUkS-KbvNIZk,30
8
+ edx_enterprise_subsidy_client-0.3.4.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- edx_enterprise_subsidy_client/__init__.py,sha256=_ecFrd8u2Qk6Rful2v2aCz7adYgyVicdASgDenrDAnk,205
2
- edx_enterprise_subsidy_client/client.py,sha256=NIhyIlJP-E0ueW3c1Fo7inbLsXEEknbRvfF0xL4dX7w,10408
3
- edx_enterprise_subsidy_client-0.3.2.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
4
- edx_enterprise_subsidy_client-0.3.2.dist-info/LICENSE.txt,sha256=QTW2QN7q3XszgUAXm9Dzgtu5LXYKbR1SGnqMa7ufEuY,35139
5
- edx_enterprise_subsidy_client-0.3.2.dist-info/METADATA,sha256=ZYZpccmgVP1E71KnEfOkoOnpMQzWe_LTueaJ_LhoVdA,8758
6
- edx_enterprise_subsidy_client-0.3.2.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
7
- edx_enterprise_subsidy_client-0.3.2.dist-info/top_level.txt,sha256=X3PxOH44rjQXFaA8EX-ZpUEL4SjfMM_yUkS-KbvNIZk,30
8
- edx_enterprise_subsidy_client-0.3.2.dist-info/RECORD,,