From 76931d403ce2c101346ae9b28030e644a9c86c92 Mon Sep 17 00:00:00 2001 From: 20128094 <20128094@tafe.wa.edu.au> Date: Wed, 20 Nov 2024 23:50:33 +0800 Subject: [PATCH] docs(Clients_service): Added comments to clarify the functions that i created --- .../__pycache__/service.cpython-312.pyc | Bin 4099 -> 5171 bytes myfinances/clients/service.py | 26 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/myfinances/clients/__pycache__/service.cpython-312.pyc b/myfinances/clients/__pycache__/service.cpython-312.pyc index 781aea274837c26f724df891eae77c2071ce86cc..10ad26c25ed331f12576a2326346fdba5d9b72f0 100644 GIT binary patch delta 1139 zcmaJ=&ubJh7|l>?>uk5b!6MuCL;GVb)dgXt_8^FQ5GkTX5Q;46Otu@DO~xdxR*+Tv z2gEt`*52Bi(u+rL3SQci9z^^T22{M7%*>`!N;`+iyv)nX``(wlf!%WN*J9B{`q?>k zedYDwhu(sFAL9;$T*#h>p^p`1D}Wi0=Ts)&UO)*`(-M55Fb(7^Jfo@sszD$We2x0V zhY$2Wm z5l3aLpM(Y(Ew9vS*8@PB+Hy|gw!w?3A1joSuP0)1Bi*!hw;6U9HDoVIRna4cZPl-br79a;;T%Flf*K{ z5Li{K6wP*zM+@C^!$4(r=6qXdbk6< z^h*UB0`;>EN|$ePR;QwAu93MTeon;Tbcx*~8tDo8pXy5~tNQf{#lvWLBzo8L&H1?d zqUh&%Ond>V~SZ8r8tD{+^B-3ZFt9UCv>GX}Y6y0R^| znsLFP9yD|1{lv~#Tr{Y+&FnL%AB|3KE^aKu0|pJY{|%+++T9Dzm#h184}K>TkDNkh lbyLPj4||mxpQiRJcmAM4biQwIKsZkI?b2UlMp4qW{0I1fZVLba delta 253 zcmdn2(X7CCnwOW00SLqx?9vtaHu74r!=PofL1m@f2VM}552lhI#1mkURb3D~)AxfQ zh$jS-6Nd0Cy_FbGm|e68`V1B@V`4R3Q2c=bNL|o(JfL<_-}4It)8ruG3xW}hjHVN! MzcPU6A{n4Z0830s_W%F@ diff --git a/myfinances/clients/service.py b/myfinances/clients/service.py index 51b9dab..9d7b88c 100644 --- a/myfinances/clients/service.py +++ b/myfinances/clients/service.py @@ -76,6 +76,23 @@ def update_client(self, address: Optional[str] = None, city: Optional[str] = None, country: Optional[str] = None) -> MyFinancesResponse[Client]: + """ + Updating an existing client's details, with the provided parameters + + Args: + name (Optional[str]): name of the client to update + phone_number (Optional[str]): client's phone number to update + email (Optional[EmailStr]): client's email address to update + company (Optional[str]): client's company name to update + contact_method (Optional[str]): client's preferred contact to update + is_representative (Optional[bool]): to update the client if they are representative + address (Optional[str]): client's address to update + city (Optional[str]): client's location in the city to update + country (Optional[str]): client's country location to update + + Returns: + MyFinancesResponse[Client]: Data of the client's details is updated + """ params = { key: value for key, value in{ "name": name, @@ -94,5 +111,14 @@ def update_client(self, return MyFinancesResponse(**response.dict()) def delete_client(self, client_id: int) -> MyFinancesResponse[Client]: + """ + Deletion of a specific client + + Args: + client_id (int): client's id + + Returns: + MyFinancesResponse[Client]: Confirming the deletion of the client + """ response = self._client._delete(f"/clients/{client_id}/delete") return MyFinancesResponse(**response.dict())