Conversation
Fix types
Extend types.py
Add tests Add cassette Add method description
| data: Union[PhotoInputData, SelfiePhotoInputData, SelfieVideoInputData], | ||
| group: int = None | ||
| ): | ||
| if group is not None: |
There was a problem hiding this comment.
Not sure about this, does there any other way to not pass group if is None?
There was a problem hiding this comment.
this looks ok. you can also add group key after initializing the required keys to avoid code duplication I guess
There was a problem hiding this comment.
But I will have to add group property for every instance?
mati/api_service.py
Outdated
| ) | ||
| ) | ||
|
|
||
| def send_input(self, identity_id: str, inputs_data: InputsData) -> List[Dict[str, bool]]: |
There was a problem hiding this comment.
can we have class name and its structure like we have in js lib (SendInputRequest)?
Rename InputsData class to SendInputRequest
| group: int = None | ||
| ): | ||
| if group is not None: | ||
| dict.__init__( |
There was a problem hiding this comment.
any reason not to use super() here and in the else branch?
There was a problem hiding this comment.
I need to serialize this structure with json.dumps in the future so I inherited from dict. There are two different structures with the group and without and if group equals None it converts to null and it's not correct for our case, so I used super constructor to handle such case
mati/api_service.py
Outdated
| encoder = MultipartEncoder(files) | ||
| endpoint = 'v2/identities/{identity_id}/send-input' | ||
| return self._call_http( | ||
| path=endpoint.format(identity_id=identity_id), |
There was a problem hiding this comment.
f-string would look nicer here :) like this:
...
path=f'v2/identities/{identity_id}/send-input',
...
| data: Union[PhotoInputData, SelfiePhotoInputData, SelfieVideoInputData], | ||
| group: int = None | ||
| ): | ||
| if group is not None: |
There was a problem hiding this comment.
this looks ok. you can also add group key after initializing the required keys to avoid code duplication I guess
Use f-string
No description provided.