7
7
// </auto-generated>
8
8
//------------------------------------------------------------------------------
9
9
#nullable enable
10
- namespace Openapi
10
+ namespace Codat . Sync . Payables
11
11
{
12
+ using Codat . Sync . Payables . Hooks ;
13
+ using Codat . Sync . Payables . Models . Components ;
14
+ using Codat . Sync . Payables . Models . Errors ;
15
+ using Codat . Sync . Payables . Models . Requests ;
16
+ using Codat . Sync . Payables . Utils . Retries ;
17
+ using Codat . Sync . Payables . Utils ;
12
18
using Newtonsoft . Json ;
13
- using Openapi . Hooks ;
14
- using Openapi . Models . Components ;
15
- using Openapi . Models . Errors ;
16
- using Openapi . Models . Requests ;
17
- using Openapi . Utils . Retries ;
18
- using Openapi . Utils ;
19
19
using System . Collections . Generic ;
20
20
using System . Net . Http . Headers ;
21
21
using System . Net . Http ;
@@ -39,7 +39,7 @@ public interface IBillPayments
39
39
/// Mapping options are a set of bank accounts used to configure the SMB's payables integration.
40
40
/// </remarks>
41
41
/// </summary>
42
- Task < GetMappingOptionsPaymentsResponse > GetPaymentOptionsAsync ( string companyId , string connectionId , string ? continuationToken = null , string ? statusQuery = null , RetryConfig ? retryConfig = null ) ;
42
+ Task < GetMappingOptionsPaymentsResponse > GetPaymentOptionsAsync ( GetMappingOptionsPaymentsRequest request , RetryConfig ? retryConfig = null ) ;
43
43
44
44
/// <summary>
45
45
/// Create bill payment
@@ -60,31 +60,24 @@ public class BillPayments: IBillPayments
60
60
{
61
61
public SDKConfig SDKConfiguration { get ; private set ; }
62
62
private const string _language = "csharp" ;
63
- private const string _sdkVersion = "0 .0.10 " ;
64
- private const string _sdkGenVersion = "2.411.9 " ;
63
+ private const string _sdkVersion = "4 .0.0 " ;
64
+ private const string _sdkGenVersion = "2.413.0 " ;
65
65
private const string _openapiDocVersion = "3.0.0" ;
66
- private const string _userAgent = "speakeasy-sdk/csharp 0 .0.10 2.411.9 3.0.0 Openapi " ;
66
+ private const string _userAgent = "speakeasy-sdk/csharp 4 .0.0 2.413.0 3.0.0 Codat.Sync.Payables " ;
67
67
private string _serverUrl = "" ;
68
68
private ISpeakeasyHttpClient _client ;
69
- private Func < Openapi . Models . Components . Security > ? _securitySource ;
69
+ private Func < Codat . Sync . Payables . Models . Components . Security > ? _securitySource ;
70
70
71
- public BillPayments ( ISpeakeasyHttpClient client , Func < Openapi . Models . Components . Security > ? securitySource , string serverUrl , SDKConfig config )
71
+ public BillPayments ( ISpeakeasyHttpClient client , Func < Codat . Sync . Payables . Models . Components . Security > ? securitySource , string serverUrl , SDKConfig config )
72
72
{
73
73
_client = client ;
74
74
_securitySource = securitySource ;
75
75
_serverUrl = serverUrl ;
76
76
SDKConfiguration = config ;
77
77
}
78
78
79
- public async Task < GetMappingOptionsPaymentsResponse > GetPaymentOptionsAsync ( string companyId , string connectionId , string ? continuationToken = null , string ? statusQuery = null , RetryConfig ? retryConfig = null )
79
+ public async Task < GetMappingOptionsPaymentsResponse > GetPaymentOptionsAsync ( GetMappingOptionsPaymentsRequest request , RetryConfig ? retryConfig = null )
80
80
{
81
- var request = new GetMappingOptionsPaymentsRequest ( )
82
- {
83
- CompanyId = companyId ,
84
- ConnectionId = connectionId ,
85
- ContinuationToken = continuationToken ,
86
- StatusQuery = statusQuery ,
87
- } ;
88
81
string baseUrl = this . SDKConfiguration . GetTemplatedServerUrl ( ) ;
89
82
var urlString = URLBuilder . Build ( baseUrl , "/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/payments" , request ) ;
90
83
@@ -133,7 +126,7 @@ public async Task<GetMappingOptionsPaymentsResponse> GetPaymentOptionsAsync(stri
133
126
var _httpRequest = await _client . CloneAsync ( httpRequest ) ;
134
127
return await _client . SendAsync ( _httpRequest ) ;
135
128
} ;
136
- var retries = new Openapi . Utils . Retries . Retries ( retrySend , retryConfig , statusCodes ) ;
129
+ var retries = new Codat . Sync . Payables . Utils . Retries . Retries ( retrySend , retryConfig , statusCodes ) ;
137
130
138
131
HttpResponseMessage httpResponse ;
139
132
try
@@ -174,18 +167,16 @@ public async Task<GetMappingOptionsPaymentsResponse> GetPaymentOptionsAsync(stri
174
167
var obj = ResponseBodyDeserializer . Deserialize < PaymentMappingOptions > ( await httpResponse . Content . ReadAsStringAsync ( ) , NullValueHandling . Ignore ) ;
175
168
var response = new GetMappingOptionsPaymentsResponse ( )
176
169
{
177
- HttpMeta = new Models . Components . HTTPMetadata ( )
178
- {
179
- Response = httpResponse ,
180
- Request = httpRequest
181
- }
170
+ StatusCode = responseStatusCode ,
171
+ ContentType = contentType ,
172
+ RawResponse = httpResponse
182
173
} ;
183
174
response . PaymentMappingOptions = obj ;
184
175
return response ;
185
176
}
186
177
else
187
178
{
188
- throw new SDKException ( "Unknown content type received" , httpRequest , httpResponse ) ;
179
+ throw new SDKException ( "Unknown content type received" , responseStatusCode , await httpResponse . Content . ReadAsStringAsync ( ) , httpResponse ) ;
189
180
}
190
181
}
191
182
else if ( new List < int > { 400 , 401 , 402 , 403 , 404 , 429 , 500 , 503 } . Contains ( responseStatusCode ) )
@@ -197,16 +188,16 @@ public async Task<GetMappingOptionsPaymentsResponse> GetPaymentOptionsAsync(stri
197
188
}
198
189
else
199
190
{
200
- throw new SDKException ( "Unknown content type received" , httpRequest , httpResponse ) ;
191
+ throw new SDKException ( "Unknown content type received" , responseStatusCode , await httpResponse . Content . ReadAsStringAsync ( ) , httpResponse ) ;
201
192
}
202
193
}
203
194
else if ( responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600 )
204
195
{
205
- throw new SDKException ( "API error occurred" , httpRequest , httpResponse ) ;
196
+ throw new SDKException ( "API error occurred" , responseStatusCode , await httpResponse . Content . ReadAsStringAsync ( ) , httpResponse ) ;
206
197
}
207
198
else
208
199
{
209
- throw new SDKException ( "Unknown status code received" , httpRequest , httpResponse ) ;
200
+ throw new SDKException ( "Unknown status code received" , responseStatusCode , await httpResponse . Content . ReadAsStringAsync ( ) , httpResponse ) ;
210
201
}
211
202
}
212
203
@@ -267,7 +258,7 @@ public async Task<CreateBillPaymentResponse> CreateAsync(CreateBillPaymentReques
267
258
var _httpRequest = await _client . CloneAsync ( httpRequest ) ;
268
259
return await _client . SendAsync ( _httpRequest ) ;
269
260
} ;
270
- var retries = new Openapi . Utils . Retries . Retries ( retrySend , retryConfig , statusCodes ) ;
261
+ var retries = new Codat . Sync . Payables . Utils . Retries . Retries ( retrySend , retryConfig , statusCodes ) ;
271
262
272
263
HttpResponseMessage httpResponse ;
273
264
try
@@ -308,18 +299,16 @@ public async Task<CreateBillPaymentResponse> CreateAsync(CreateBillPaymentReques
308
299
var obj = ResponseBodyDeserializer . Deserialize < BillPayment > ( await httpResponse . Content . ReadAsStringAsync ( ) , NullValueHandling . Ignore ) ;
309
300
var response = new CreateBillPaymentResponse ( )
310
301
{
311
- HttpMeta = new Models . Components . HTTPMetadata ( )
312
- {
313
- Response = httpResponse ,
314
- Request = httpRequest
315
- }
302
+ StatusCode = responseStatusCode ,
303
+ ContentType = contentType ,
304
+ RawResponse = httpResponse
316
305
} ;
317
306
response . BillPayment = obj ;
318
307
return response ;
319
308
}
320
309
else
321
310
{
322
- throw new SDKException ( "Unknown content type received" , httpRequest , httpResponse ) ;
311
+ throw new SDKException ( "Unknown content type received" , responseStatusCode , await httpResponse . Content . ReadAsStringAsync ( ) , httpResponse ) ;
323
312
}
324
313
}
325
314
else if ( new List < int > { 400 , 401 , 402 , 403 , 404 , 409 , 429 , 500 , 503 } . Contains ( responseStatusCode ) )
@@ -331,16 +320,16 @@ public async Task<CreateBillPaymentResponse> CreateAsync(CreateBillPaymentReques
331
320
}
332
321
else
333
322
{
334
- throw new SDKException ( "Unknown content type received" , httpRequest , httpResponse ) ;
323
+ throw new SDKException ( "Unknown content type received" , responseStatusCode , await httpResponse . Content . ReadAsStringAsync ( ) , httpResponse ) ;
335
324
}
336
325
}
337
326
else if ( responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600 )
338
327
{
339
- throw new SDKException ( "API error occurred" , httpRequest , httpResponse ) ;
328
+ throw new SDKException ( "API error occurred" , responseStatusCode , await httpResponse . Content . ReadAsStringAsync ( ) , httpResponse ) ;
340
329
}
341
330
else
342
331
{
343
- throw new SDKException ( "Unknown status code received" , httpRequest , httpResponse ) ;
332
+ throw new SDKException ( "Unknown status code received" , responseStatusCode , await httpResponse . Content . ReadAsStringAsync ( ) , httpResponse ) ;
344
333
}
345
334
}
346
335
}
0 commit comments