Skip to content

Commit a7e4bba

Browse files
committed
"response" is confusing. Call it "responses"
This is the response from the batch call, but it returns a collection of responses. So I can see why it was called "response", but it feels less confusing to call it "responses".
1 parent ec9308d commit a7e4bba

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

batch_mailchimp/batches_api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Batch:
2727
def __init__(self, batches_api, **kwargs):
2828
self._batches_api = batches_api
2929
self._operations = kwargs.get("operations")
30-
self._response = None
30+
self._responses = None
3131
self.update(**kwargs)
3232

3333
def update(self, **kwargs):
@@ -55,9 +55,9 @@ def status(self, refresh=False):
5555
self._batches_api.status(self.batch_id, refresh=refresh)
5656
return self
5757

58-
def response(self):
59-
if self._response:
60-
return self._response
58+
def responses(self):
59+
if self._responses:
60+
return self._responses
6161
batch = self.status(refresh=True)
6262
if batch._status == "finished" and batch.response_body_url:
6363
content = requests.get(batch.response_body_url).content
@@ -68,11 +68,11 @@ def response(self):
6868
if file_content is None:
6969
continue
7070
output += json.load(file_content)
71-
self._response = ResponseCollection({
71+
self._responses = ResponseCollection({
7272
o["operation_id"]: Response(**o)
7373
for o in output
7474
})
75-
return self._response
75+
return self._responses
7676

7777
def delete(self):
7878
return self._batches_api.delete_request(self.batch_id)

0 commit comments

Comments
 (0)