1+ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
2+
13import requests as requests_http
24from . import utils
3- from codat .models import operations
5+ from codat .models import operations , shared
46from typing import Optional
57
68class Configuration :
9+ r"""Companies sync configuration."""
710 _client : requests_http .Session
811 _security_client : requests_http .Session
912 _server_url : str
@@ -23,7 +26,6 @@ def get_company_configuration(self, request: operations.GetCompanyConfigurationR
2326 r"""Get company configuration
2427 Gets a companies expense sync configuration
2528 """
26-
2729 base_url = self ._server_url
2830
2931 url = utils .generate_url (operations .GetCompanyConfigurationRequest , base_url , '/companies/{companyId}/sync/expenses/config' , request )
@@ -38,22 +40,21 @@ def get_company_configuration(self, request: operations.GetCompanyConfigurationR
3840
3941 if http_res .status_code == 200 :
4042 if utils .match_content_type (content_type , 'application/json' ):
41- out = utils .unmarshal_json (http_res .text , Optional [operations . GetCompanyConfiguration200ApplicationJSON ])
42- res .get_company_configuration_200_application_json_object = out
43+ out = utils .unmarshal_json (http_res .text , Optional [shared . CompanyConfiguration ])
44+ res .company_configuration = out
4345
4446 return res
4547
4648 def save_company_configuration (self , request : operations .SaveCompanyConfigurationRequest ) -> operations .SaveCompanyConfigurationResponse :
4749 r"""Set company configuration
4850 Sets a companies expense sync configuration
4951 """
50-
5152 base_url = self ._server_url
5253
5354 url = utils .generate_url (operations .SaveCompanyConfigurationRequest , base_url , '/companies/{companyId}/sync/expenses/config' , request )
5455
5556 headers = {}
56- req_content_type , data , form = utils .serialize_request_body (request , "request_body " , 'json' )
57+ req_content_type , data , form = utils .serialize_request_body (request , "company_configuration " , 'json' )
5758 if req_content_type not in ('multipart/form-data' , 'multipart/mixed' ):
5859 headers ['content-type' ] = req_content_type
5960
@@ -66,12 +67,12 @@ def save_company_configuration(self, request: operations.SaveCompanyConfiguratio
6667
6768 if http_res .status_code == 200 :
6869 if utils .match_content_type (content_type , 'application/json' ):
69- out = utils .unmarshal_json (http_res .text , Optional [operations . SaveCompanyConfiguration200ApplicationJSON ])
70- res .save_company_configuration_200_application_json_object = out
70+ out = utils .unmarshal_json (http_res .text , Optional [shared . CompanyConfiguration ])
71+ res .company_configuration = out
7172 elif http_res .status_code == 400 :
7273 if utils .match_content_type (content_type , 'application/json' ):
73- out = utils .unmarshal_json (http_res .text , Optional [operations . SaveCompanyConfiguration400ApplicationJSON ])
74- res .save_company_configuration_400_application_json_object = out
74+ out = utils .unmarshal_json (http_res .text , Optional [shared . CodatErrorMessage ])
75+ res .codat_error_message = out
7576
7677 return res
7778
0 commit comments