66from codat_sync_for_payables .models import errors , operations , shared
77from codat_sync_for_payables .types import BaseModel , OptionalNullable , UNSET
88import httpx
9- from typing import Any , Optional , Union , cast
9+ from typing import Any , List , Optional , Union , cast
1010
1111
1212class Bills (BaseSDK ):
@@ -692,7 +692,7 @@ def upload_attachment(
692692 retries : OptionalNullable [utils .RetryConfig ] = UNSET ,
693693 server_url : Optional [str ] = None ,
694694 timeout_ms : Optional [int ] = None ,
695- ):
695+ ) -> shared . Attachment :
696696 r"""Upload bill attachment
697697
698698 The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`.
@@ -773,8 +773,8 @@ def upload_attachment(
773773 )
774774
775775 data : Any = None
776- if utils .match_response (http_res , "201" , "* " ):
777- return
776+ if utils .match_response (http_res , "201" , "application/json " ):
777+ return utils . unmarshal_json ( http_res . text , shared . Attachment )
778778 if utils .match_response (
779779 http_res ,
780780 ["400" , "401" , "402" , "403" , "404" , "429" , "500" , "503" ],
@@ -807,7 +807,7 @@ async def upload_attachment_async(
807807 retries : OptionalNullable [utils .RetryConfig ] = UNSET ,
808808 server_url : Optional [str ] = None ,
809809 timeout_ms : Optional [int ] = None ,
810- ):
810+ ) -> shared . Attachment :
811811 r"""Upload bill attachment
812812
813813 The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`.
@@ -888,8 +888,8 @@ async def upload_attachment_async(
888888 )
889889
890890 data : Any = None
891- if utils .match_response (http_res , "201" , "* " ):
892- return
891+ if utils .match_response (http_res , "201" , "application/json " ):
892+ return utils . unmarshal_json ( http_res . text , shared . Attachment )
893893 if utils .match_response (
894894 http_res ,
895895 ["400" , "401" , "402" , "403" , "404" , "429" , "500" , "503" ],
@@ -922,7 +922,7 @@ def list_attachments(
922922 retries : OptionalNullable [utils .RetryConfig ] = UNSET ,
923923 server_url : Optional [str ] = None ,
924924 timeout_ms : Optional [int ] = None ,
925- ) -> shared .Attachment :
925+ ) -> List [ shared .Attachment ] :
926926 r"""List bill attachments
927927
928928 The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`.
@@ -948,7 +948,7 @@ def list_attachments(
948948
949949 req = self .build_request (
950950 method = "GET" ,
951- path = "/companies/{companyId}/connections/{connectionId}/bills/{billId}/attachments" ,
951+ path = "/companies/{companyId}/connections/{connectionId}/payables/ bills/{billId}/attachments" ,
952952 base_url = base_url ,
953953 url_variables = url_variables ,
954954 request = request ,
@@ -997,7 +997,7 @@ def list_attachments(
997997
998998 data : Any = None
999999 if utils .match_response (http_res , "200" , "application/json" ):
1000- return utils .unmarshal_json (http_res .text , shared .Attachment )
1000+ return utils .unmarshal_json (http_res .text , List [ shared .Attachment ] )
10011001 if utils .match_response (
10021002 http_res ,
10031003 ["401" , "402" , "403" , "404" , "409" , "429" , "500" , "503" ],
@@ -1030,7 +1030,7 @@ async def list_attachments_async(
10301030 retries : OptionalNullable [utils .RetryConfig ] = UNSET ,
10311031 server_url : Optional [str ] = None ,
10321032 timeout_ms : Optional [int ] = None ,
1033- ) -> shared .Attachment :
1033+ ) -> List [ shared .Attachment ] :
10341034 r"""List bill attachments
10351035
10361036 The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`.
@@ -1056,7 +1056,7 @@ async def list_attachments_async(
10561056
10571057 req = self .build_request_async (
10581058 method = "GET" ,
1059- path = "/companies/{companyId}/connections/{connectionId}/bills/{billId}/attachments" ,
1059+ path = "/companies/{companyId}/connections/{connectionId}/payables/ bills/{billId}/attachments" ,
10601060 base_url = base_url ,
10611061 url_variables = url_variables ,
10621062 request = request ,
@@ -1105,7 +1105,7 @@ async def list_attachments_async(
11051105
11061106 data : Any = None
11071107 if utils .match_response (http_res , "200" , "application/json" ):
1108- return utils .unmarshal_json (http_res .text , shared .Attachment )
1108+ return utils .unmarshal_json (http_res .text , List [ shared .Attachment ] )
11091109 if utils .match_response (
11101110 http_res ,
11111111 ["401" , "402" , "403" , "404" , "409" , "429" , "500" , "503" ],
0 commit comments