@@ -109,10 +109,10 @@ public class Bills: IBills
109109 {
110110 public SDKConfig SDKConfiguration { get ; private set ; }
111111 private const string _language = "csharp" ;
112- private const string _sdkVersion = "8 .0.0" ;
113- private const string _sdkGenVersion = "2.442.11 " ;
112+ private const string _sdkVersion = "9 .0.0" ;
113+ private const string _sdkGenVersion = "2.445.1 " ;
114114 private const string _openapiDocVersion = "3.0.0" ;
115- private const string _userAgent = "speakeasy-sdk/csharp 8 .0.0 2.442.11 3.0.0 Codat.Sync.Payables" ;
115+ private const string _userAgent = "speakeasy-sdk/csharp 9 .0.0 2.445.1 3.0.0 Codat.Sync.Payables" ;
116116 private string _serverUrl = "" ;
117117 private ISpeakeasyHttpClient _client ;
118118 private Func < Codat . Sync . Payables . Models . Components . Security > ? _securitySource ;
@@ -580,13 +580,21 @@ public async Task<UploadBillAttachmentResponse> UploadAttachmentAsync(UploadBill
580580 var contentType = httpResponse . Content . Headers . ContentType ? . MediaType ;
581581 int responseStatusCode = ( int ) httpResponse . StatusCode ;
582582 if ( responseStatusCode == 201 )
583- {
584- return new UploadBillAttachmentResponse ( )
583+ {
584+ if ( Utilities . IsContentTypeMatch ( "application/json" , contentType ) )
585585 {
586- StatusCode = responseStatusCode ,
587- ContentType = contentType ,
588- RawResponse = httpResponse
589- } ;
586+ var obj = ResponseBodyDeserializer . Deserialize < Attachment > ( await httpResponse . Content . ReadAsStringAsync ( ) , NullValueHandling . Ignore ) ;
587+ var response = new UploadBillAttachmentResponse ( )
588+ {
589+ StatusCode = responseStatusCode ,
590+ ContentType = contentType ,
591+ RawResponse = httpResponse
592+ } ;
593+ response . Attachment = obj ;
594+ return response ;
595+ }
596+
597+ throw new Models . Errors . SDKException ( "Unknown content type received" , responseStatusCode , await httpResponse . Content . ReadAsStringAsync ( ) , httpResponse ) ;
590598 }
591599 else if ( new List < int > { 400 , 401 , 402 , 403 , 404 , 429 , 500 , 503 } . Contains ( responseStatusCode ) )
592600 {
@@ -609,7 +617,7 @@ public async Task<UploadBillAttachmentResponse> UploadAttachmentAsync(UploadBill
609617 public async Task < ListBillAttachmentsResponse > ListAttachmentsAsync ( ListBillAttachmentsRequest request , RetryConfig ? retryConfig = null )
610618 {
611619 string baseUrl = this . SDKConfiguration . GetTemplatedServerUrl ( ) ;
612- var urlString = URLBuilder . Build ( baseUrl , "/companies/{companyId}/connections/{connectionId}/bills/{billId}/attachments" , request ) ;
620+ var urlString = URLBuilder . Build ( baseUrl , "/companies/{companyId}/connections/{connectionId}/payables/ bills/{billId}/attachments" , request ) ;
613621
614622 var httpRequest = new HttpRequestMessage ( HttpMethod . Get , urlString ) ;
615623 httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
@@ -694,14 +702,14 @@ public async Task<ListBillAttachmentsResponse> ListAttachmentsAsync(ListBillAtta
694702 {
695703 if ( Utilities . IsContentTypeMatch ( "application/json" , contentType ) )
696704 {
697- var obj = ResponseBodyDeserializer . Deserialize < Attachment > ( await httpResponse . Content . ReadAsStringAsync ( ) , NullValueHandling . Ignore ) ;
705+ var obj = ResponseBodyDeserializer . Deserialize < List < Attachment > > ( await httpResponse . Content . ReadAsStringAsync ( ) , NullValueHandling . Ignore ) ;
698706 var response = new ListBillAttachmentsResponse ( )
699707 {
700708 StatusCode = responseStatusCode ,
701709 ContentType = contentType ,
702710 RawResponse = httpResponse
703711 } ;
704- response . Attachment = obj ;
712+ response . Attachments = obj ;
705713 return response ;
706714 }
707715
0 commit comments