@@ -109,10 +109,10 @@ public class Bills: IBills
109
109
{
110
110
public SDKConfig SDKConfiguration { get ; private set ; }
111
111
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 " ;
114
114
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" ;
116
116
private string _serverUrl = "" ;
117
117
private ISpeakeasyHttpClient _client ;
118
118
private Func < Codat . Sync . Payables . Models . Components . Security > ? _securitySource ;
@@ -580,13 +580,21 @@ public async Task<UploadBillAttachmentResponse> UploadAttachmentAsync(UploadBill
580
580
var contentType = httpResponse . Content . Headers . ContentType ? . MediaType ;
581
581
int responseStatusCode = ( int ) httpResponse . StatusCode ;
582
582
if ( responseStatusCode == 201 )
583
- {
584
- return new UploadBillAttachmentResponse ( )
583
+ {
584
+ if ( Utilities . IsContentTypeMatch ( "application/json" , contentType ) )
585
585
{
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 ) ;
590
598
}
591
599
else if ( new List < int > { 400 , 401 , 402 , 403 , 404 , 429 , 500 , 503 } . Contains ( responseStatusCode ) )
592
600
{
@@ -609,7 +617,7 @@ public async Task<UploadBillAttachmentResponse> UploadAttachmentAsync(UploadBill
609
617
public async Task < ListBillAttachmentsResponse > ListAttachmentsAsync ( ListBillAttachmentsRequest request , RetryConfig ? retryConfig = null )
610
618
{
611
619
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 ) ;
613
621
614
622
var httpRequest = new HttpRequestMessage ( HttpMethod . Get , urlString ) ;
615
623
httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
@@ -694,14 +702,14 @@ public async Task<ListBillAttachmentsResponse> ListAttachmentsAsync(ListBillAtta
694
702
{
695
703
if ( Utilities . IsContentTypeMatch ( "application/json" , contentType ) )
696
704
{
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 ) ;
698
706
var response = new ListBillAttachmentsResponse ( )
699
707
{
700
708
StatusCode = responseStatusCode ,
701
709
ContentType = contentType ,
702
710
RawResponse = httpResponse
703
711
} ;
704
- response . Attachment = obj ;
712
+ response . Attachments = obj ;
705
713
return response ;
706
714
}
707
715
0 commit comments