Skip to content

Commit 7fba51c

Browse files
author
Sam Wierema
committed
Re-structure the Verify methods to include all functionality
One of the missing elements was viewing a single verification. To accomplish this the old `verify` method was moved to be called `verify_verify` (I know, a bit strange, but it works), while the `verify` method now only views a specific verification. The `verify_create` method was altered to only require the required paramater from the API (`recipient`). The `originator` paramater is now an optional.
1 parent 271f377 commit 7fba51c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Diff for: messagebird/client.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,15 @@ def lookup_hlr_create(self, phonenumber, params={}):
106106
"""Perform a new HLR lookup."""
107107
return HLR().load(self.request('lookup/' + str(phonenumber) + '/hlr', 'POST', params))
108108

109-
def verify(self, id, token):
110-
"""Retrieve the information of a specific message."""
111-
return Verify().load(self.request('verify/' + str(id), params={'token': token}))
109+
def verify(self, id):
110+
"""Retrieve the information of a specific verification."""
111+
return Verify().load(self.request('verify/' + str(id)))
112112

113-
def verify_create(self, originator, phonenumber, params={}):
113+
def verify_create(self, recipient, params={}):
114114
"""Create a new verification."""
115-
params.update({ 'originator' : originator, 'recipient' : phonenumber })
116-
return Verify().load(self.request('verify', 'POST', params))
115+
params.update({ 'recipient' : recipient })
116+
return Verify().load(self.request('verify', 'POST', params))
117+
118+
def verify_verify(self, id, token):
119+
"""Verify the token of a specific verification."""
120+
return Verify().load(self.request('verify/' + str(id), params={'token': token}))

0 commit comments

Comments
 (0)